Skip to main content

Crate navcore_ffi

Crate navcore_ffi 

Source
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§

FfiChartStore
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.
FfiVesselState
What a client draws about own ship at one instant.

Enums§

FfiRouteError
Everything that can go wrong opening a chart or finding a route, flattened to one message for the foreign side. See enc_store::StoreError and route_find::FindError for what actually failed; UniFFI’s flat_error only ever lowers a Display string across the boundary, not the structured original.