pub struct VesselState {
pub position: Position,
pub cog_deg: f64,
pub sog_kn: f64,
pub heading_deg: Option<f64>,
}Expand description
What a client knows about own ship at one instant.
Fields§
§position: PositionWhere the vessel is.
cog_deg: f64Course over ground, degrees true.
sog_kn: f64Speed over ground, knots.
heading_deg: Option<f64>Heading, degrees true, when the vessel has a compass.
Differs from course when there is leeway or current. None when
the vessel has no heading sensor; substituting course in that
case would misrepresent a measurement as heading.
Implementations§
Source§impl VesselState
impl VesselState
Sourcepub fn predictor_end(&self) -> Position
pub fn predictor_end(&self) -> Position
The far end of the course predictor: where the vessel reaches if it
holds this course and speed for PREDICTOR_MINUTES.
Sourcepub fn heading_line_end(&self) -> Option<Position>
pub fn heading_line_end(&self) -> Option<Position>
The far end of the heading line: where the bow points, which differs from the course over ground under leeway or current.
Length matches the course predictor so the angle between them is
directly comparable, with a floor (MIN_HEADING_LINE_NM) so
the line stays visible for a vessel stopped in a tideway. None
when there is no compass; no line is drawn in that case.
Trait Implementations§
Source§impl Clone for VesselState
impl Clone for VesselState
Source§fn clone(&self) -> VesselState
fn clone(&self) -> VesselState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for VesselState
Source§impl Debug for VesselState
impl Debug for VesselState
Source§impl PartialEq for VesselState
impl PartialEq for VesselState
Source§fn eq(&self, other: &VesselState) -> bool
fn eq(&self, other: &VesselState) -> bool
self and other values to be equal, and is used by ==.