Skip to main content

Track

Struct Track 

Source
pub struct Track {
    pub uuid: Option<String>,
    pub name: Option<String>,
    pub description: Option<String>,
    pub color: Option<String>,
    pub distance_m: Option<f64>,
    pub points: Vec<Position>,
    pub timestamp: Option<String>,
    pub recorded_from: Option<String>,
    pub recorded_to: Option<String>,
}
Expand description

A recorded track, as the wire carries it.

Not a Signal K spec resource type – confirmed against signalk-server’s own dist/api/resources/index.js: only waypoints/routes/regions/notes/charts are ever registered by the server itself. tracks only exists at all once a server’s own @signalk/resources-provider plugin has been configured with it as a “custom” collection – at which point it answers the exact same generic GET/POST/PUT/DELETE shape every resource type here does, this module’s own doc already explains why. No isSignalKResourceType schema validates a write against this shape server-side the way one does for routes/waypoints, so it is tracks’s crate’s own choice, not a spec’s – see tracks::signalk’s own doc, which this exists to serve, for the fuller reasoning and for why it is not simply Freeboard-SK’s own (undocumented, display-only) tracks convention adopted wholesale.

Fields§

§uuid: Option<String>

The server’s own id, once it has one – the same None-until- published convention Route::uuid uses, for the same reason.

§name: Option<String>

What the mariner calls it.

§description: Option<String>

Anything they wrote about it.

§color: Option<String>

A hex colour ("#rrggbb"), feature.properties.color, the same place Waypoint::color already lives – but a free hex value here rather than Waypoint::color’s own small named palette: telling several tracks apart on one chart at once wants more distinct choices than a waypoint marker’s four colours give.

§distance_m: Option<f64>

Total length, when the caller has one to send or the server sent one back. Never trusted over a fresh local recomputation – tracks::signalk’s own doc gives the same reasoning routes::signalk’s already does for a route’s own distance.

§points: Vec<Position>

The line itself, in the order it was recorded. No per-point names the way RoutePoint can carry one: a recorded point has nowhere a name would come from, unlike a route’s own waypoints, which a mariner placed and could label as they went.

§timestamp: Option<String>

When the server itself last saved this – the generic resource wrapper’s own top-level timestamp, RFC 3339, confirmed live ("$source":"resources-provider" alongside it in a real GET answer). None only for a Track not yet published, which has no server-assigned timestamp to carry – one this crate wrote itself never sends this back up; it is read-only, the server’s own to set. Kept as the plain string rather than parsed: RFC 3339 UTC timestamps already sort correctly as plain text, and nothing in this workspace pulls in a date/time crate merely to hold one.

§recorded_from: Option<String>

When recording actually started, RFC 3339 – feature.properties.startTime. Unlike Self::timestamp, this is the mariner’s own client’s to set, and is sent up on a write.

§recorded_to: Option<String>

When recording actually stopped, RFC 3339 – feature.properties.endTime. Same as Self::recorded_from.

Trait Implementations§

Source§

impl Clone for Track

Source§

fn clone(&self) -> Track

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Track

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Track

Source§

fn eq(&self, other: &Track) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Track

Auto Trait Implementations§

§

impl Freeze for Track

§

impl RefUnwindSafe for Track

§

impl Send for Track

§

impl Sync for Track

§

impl Unpin for Track

§

impl UnsafeUnpin for Track

§

impl UnwindSafe for Track

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.