Expand description
The UniFFI adapter: nav-core’s boundary to clients written in other languages.
Everything UniFFI-shaped lives here, in the outermost layer, rather than
as derives bolted onto fix or nav-math’s own types – the workspace
Cargo.toml’s own architecture comment is “nav-math must not know
Signal K exists”, and a #[derive(uniffi::Record)] on fix::VesselState would
be exactly that. This crate converts, it does not redefine: the types
it wraps stay exactly what they are elsewhere.
Deliberately narrow for now: a client has nothing to draw without a
source of vessel state, and FfiSimulator is the only one that
exists yet, so it is the only one exposed. A real one (Signal K) joins
later without this shape needing to change.
route is the other side of that same growth: a client that can
draw a vessel also needs somewhere to send it, and route_find is
nav-core’s answer to “where.”
Structs§
- FfiChart
Store - A chart, opened once and reused for as many route queries as the foreign side wants.
- FfiPosition
- A geographic position, crossing the FFI boundary.
- FfiSimulator
- A vessel with nothing real behind it, for a client to have something to
draw before any real source exists – see
Simulator’s own doc. - FfiVessel
State - What a client draws about own ship at one instant.
Enums§
- FfiRoute
Error - Everything that can go wrong opening a chart or finding a route,
flattened to one message for the foreign side. See
enc_store::StoreErrorandroute_find::FindErrorfor what actually failed; UniFFI’sflat_erroronly ever lowers aDisplaystring across the boundary, not the structured original.