Rust API and crate map
Ferrex’s Rust workspace is split into reusable model/core crates, the HTTP server, configuration tooling, and extracted desktop-player domain crates. Use this map when deciding where a public type should live, where rustdoc should point reviewers, and which crate owns a boundary.
Build local rustdoc
Section titled “Build local rustdoc”Run local API documentation from the repository root:
cargo doc --workspace --no-deps --all-featuresThe generated entry point is target/doc/ferrex_core/index.html and the crate list in the rustdoc sidebar should match the workspace members listed below. Canonical docs.rs links are included for packages that are published or will be published under the current package names.
Foundational crates
Section titled “Foundational crates”| Crate | Manifest | Responsibility | Key public surfaces | Rustdoc |
|---|---|---|---|---|
ferrex-model | crates/ferrex-model/Cargo.toml | Dependency-light data models shared by server, player, FlatBuffers, and tooling. | Media, Library, typed ids, details, image DTOs, scan events, watch-state DTOs, prelude. | docs.rs |
ferrex-contracts | crates/ferrex-contracts/Cargo.toml | Trait layer over ferrex-model values and rkyv archives. | MediaIDLike, MediaOps, MediaLike, Playable, Browsable, prelude. | docs.rs |
ferrex-core | crates/ferrex-core/Cargo.toml | Reusable domain, API DTOs, query layer, database ports, and application facades. | api, domain, query, database, player_prelude, types, traits. | docs.rs |
ferrex-flatbuffers | crates/ferrex-flatbuffers/Cargo.toml | Rust side of the mobile FlatBuffers contract. | fb generated namespace, conversions, uuid_helpers, FLATBUFFERS_MIME. | docs.rs |
ferrexctl | crates/ferrexctl/Cargo.toml | Shared config bootstrapper and CLI library used by tooling and server startup. | ConfigLoader, config model re-exports, validation warnings, packaging config, runner helpers. | docs.rs |
ferrex-server | crates/ferrex-server/Cargo.toml | Axum HTTP server composition around core domain crates. | application, handlers, infra, routes, database URL guards, demo coordinator. | docs.rs |
Desktop player crates
Section titled “Desktop player crates”The desktop player has been split so reusable domains do not depend on the final UI shell. See docs/player-dependency-boundaries.md for the dependency policy.
| Crate | Manifest | Responsibility | Key public surfaces | Rustdoc |
|---|---|---|---|---|
ferrex-player-foundation | crates/ferrex-player-foundation/Cargo.toml | Dependency-light primitives at the bottom of the player stack. | Auth policy DTOs, DomainTask, repository errors, unit helpers. | docs.rs |
ferrex-player-api | crates/ferrex-player-api/Cargo.toml | HTTP client, service traits, API adapters, and player-facing DTO exports. | ApiClient, ApiClientAdapter, api_types, AuthService-adjacent API DTOs, service traits. | docs.rs |
ferrex-player-auth | crates/ferrex-player-auth/Cargo.toml | Authentication state, local encrypted storage, device identity, PIN policy, and auth service adapter. | AuthDomainState, AuthService, AuthManager, auth DTO/error re-exports. | docs.rs |
ferrex-player-repository | crates/ferrex-player-repository/Cargo.toml | Player media repository, disk cache, yoke-backed archived snapshots, and typed repository accessors. | Accessor, MediaRepo, cache types, MaybeYoked, yoke aliases. | docs.rs |
ferrex-player-library | crates/ferrex-player-library/Cargo.toml | Library domain state, scan/media subscriptions, library forms, and repository compatibility exports. | LibraryDomainState, LibraryDomain, LibrariesLoadState, scan tracking helpers. | docs.rs |
ferrex-player-media | crates/ferrex-player-media/Cargo.toml | Current media selection, season details, cached watch state, and progress helpers. | MediaDomainState, MediaDomain, watch-progress selectors and messages. | docs.rs |
ferrex-player-metadata | crates/ferrex-player-metadata/Cargo.toml | Non-UI metadata constants and future shared metadata contracts. | Image retry and cache-budget constants. | docs.rs |
ferrex-player-playback | crates/ferrex-player-playback/Cargo.toml | Playback state machine, video backend wiring, controls, track selection, and diagnostics. | PlayerDomainState, PlayerDomain, PlayerMessage, redact_playback_url. | docs.rs |
ferrex-player-search | crates/ferrex-player-search/Cargo.toml | Search state, service strategy selection, calibration, metrics, and 10-foot keyboard model. | SearchDomain, SearchState, SearchService, keyboard types, search events. | docs.rs |
ferrex-player-settings | crates/ferrex-player-settings/Cargo.toml | Settings state, section messages, view-model DTOs, and UI-agnostic reducers. | SettingsDomainState, SettingsSection, color/scale re-exports. | docs.rs |
ferrex-player-user-admin | crates/ferrex-player-user-admin/Cargo.toml | Admin user-management state, messages, and reducers. | UserManagementDomainState, UserManagementMessage, update effects. | docs.rs |
ferrex-player-ui | crates/ferrex-player-ui/Cargo.toml | Iced UI surfaces, widgets, shader assets, themes, and 10-foot views. | common, domains, infra, state, view. | docs.rs |
ferrex-player-app | crates/ferrex-player-app/Cargo.toml | Runtime application shell that assembles UI/domain/API crates. | AppConfig, run, State, compatibility shell modules. | docs.rs |
ferrex-player | crates/ferrex-player/Cargo.toml | Installed desktop-player package and compatibility facade. | Re-exports ferrex-player-app for historical ferrex_player::* imports. | docs.rs |
Documentation lint policy
Section titled “Documentation lint policy”- Workspace rustdoc now warns on missing crate-level docs; each public crate should explain its responsibility at the crate root.
- Broad
missing_docs = "allow"entries remain only where pre-alpha crates expose transitional state fields or generated code. Each remaining allow should carry a comment explaining why full enforcement is not yet feasible. ferrex-flatbufferskeeps a crate-level missing-docs allow because most public tables are generated from.fbsschemas. Hand-written conversion and helper modules should be documented.ferrex-contractsuses the workspace missing-docs warning instead of a crate-level suppression, because its public trait surface is small enough to document directly.