Skip to main content

mob_delta

Function mob_delta 

Source
pub fn mob_delta(
    source_label: &str,
    state: &str,
    message: &str,
    timestamp_rfc3339: &str,
) -> String
Expand description

The delta text a caller’s own signalk_client::stream::Connection::publish sends to raise or stand down notifications.mob.

state is the caller’s own choice – "emergency" to raise it, "normal" to stand it down, one of the schema’s own alarmState enum values (nominal/normal/alert/warn/alarm/emergency); this function does not validate it, the same “wire shape only” distance this crate keeps everywhere else. method is fixed at ["visual", "sound"] regardless – the same value freeboard-sk (Signal K’s own reference chartplotter) raises this exact notification with, confirmed by reading its own bundled source, and there is no reason for a stood-down alert to ask for less attention than the raised one did before a mariner already saw and acted on it.

timestamp_rfc3339 is the caller’s own clock, not read here: this crate deliberately keeps no clock of its own (see its own module doc, “no clock” – a recorded stream of deltas has to replay identically, which a SystemTime::now() call buried in here would break).