Skip to main content

Module signalk

Module signalk 

Source
Expand description

Signal K is the single source of truth for crate::Route. This module is not a sync backend but the only backend – see waypoints::signalk’s own doc for the fuller reasoning, including the callback-shaped spawn_* functions.

Signal K’s Resources API has no conditional write (no ETag, no If-Match), so save always replaces the server’s whole copy, the same “last write wins” a plain PUT implies. This crate keeps no local copy to detect that collision against, the same trade waypoints::signalk’s own doc explains.

Three operations: list everything the server holds, save one (create or replace – the caller always supplies the id, see crate::Route::uuid’s own doc, so this is always Signal K’s PUT, never its id-minting POST), and delete one.

Traits§

ResourcesBackend
What list/save/delete need from a Signal K resources connection – exactly Client’s own three route methods, factored out so this module’s own translation logic can be tested against a fake, without a real server, the same reason waypoints::signalk’s own ResourcesBackend exists.

Functions§

delete
Deletes a route by id.
list
Every route the server currently holds.
save
Creates or replaces route at its own id.
spawn_delete
spawn_list’s own doc, delete instead of list.
spawn_list
Runs list on a thread of its own, calling on_done with the result once it has finished. See this module’s own doc, and waypoints::signalk’s, for the callback shape.
spawn_save
spawn_list’s own doc, save instead of list.