Skip to main content

Module event

Module event 

Source
Expand description

Events returned as values.

Publish/subscribe needs listener storage (allocation), runs foreign code inside a calculation (unbounded time, possible panic, half-updated state visible) and makes delivery order incidental. Instead, a state-changing operation returns what happened in an EventList alongside its result; the caller alarms, logs or forwards. The list is #[must_use] and has fixed capacity with an explicit EventList::overflowed flag: a lost navigation event is worse than a late one.

The kernel’s events (fix acquired or lost, observation rejected, integrity or sensor health changed) are NavigationEvent. Other contexts define their own enums (guidance: waypoint reached; traffic: target lost) in their own EventList. The Event trait defines an event: a timestamp and a placeholder for unused slots. The kernel does not know outer contexts’ events; the integrating crate (alert board, application) defines the union.

Structs§

EventList
Events of one operation, in order.
SensorId
Observation source identifier: the source’s name, truncated to SENSOR_NAME_BYTES so events stay plain values.
TargetId
Target identifier: radar track number or AIS MMSI.

Enums§

NavigationEvent
Kernel event.
NavigationIntegrity
Integrity of the navigation solution as a whole.
PositionSource
Position source.
RejectionReason
Observation rejection reason.
SensorHealth
Health of one observation source, as judged by its consumer.

Constants§

MAX_EVENTS
Default per-operation event capacity.
SENSOR_NAME_BYTES
Maximum sensor name length in an event, bytes.

Traits§

Event
Type storable in an EventList: something that happened at an instant.