pub struct CursorOnTarget {
pub stale_time_ms: u64,
pub uid: String,
pub contact: Option<Contact>,
pub type: String,
pub xml_detail: Option<String>,
pub position: Option<Position>,
pub precision_location: Option<PrecisionLocation>,
pub how: String,
pub access: String,
pub qos: String,
pub opex: String,
/* private fields */
}Expand description
Cursor on Target (COT) message structure and related types
Fields§
§stale_time_ms: u64Time in milliseconds after which this COT message should be considered stale
uid: StringUnique identifier for this COT entity
contact: Option<Contact>Contact information including callsign and endpoint
type: StringCOT type hierarchy (e.g., “a-f-G-E-V-C” for friendly ground equipment)
xml_detail: Option<String>Optional XML detail block for additional COT data
position: Option<Position>Geographic position of the entity
precision_location: Option<PrecisionLocation>Precision location metadata including source information
how: StringHow this COT was generated (e.g., “m-g” for machine-generated)
access: StringAccess restrictions for this COT message
qos: StringQuality of service level
opex: StringOperational expertise or operational context
Implementations§
Source§impl CursorOnTarget
impl CursorOnTarget
Sourcepub fn new<S: AsRef<str> + ToString>(
uid: S,
type: S,
publisher: Sender<(CursorOnTarget, Option<Sender<Result<(), PublishError>>>)>,
) -> Self
pub fn new<S: AsRef<str> + ToString>( uid: S, type: S, publisher: Sender<(CursorOnTarget, Option<Sender<Result<(), PublishError>>>)>, ) -> Self
Creates a new Cursor on Target message with default values
§Arguments
uid- Unique identifier for this COT entityr#type- COT type hierarchy (e.g., “a-f-G-E-V-C” for friendly ground equipment)publisher- mpsc sender for publishing this COT message to subscribers
Sourcepub async fn publish(&self) -> Result<(), PublishError>
pub async fn publish(&self) -> Result<(), PublishError>
Publishes this COT message to all subscribers via the mpsc channel
Clones the current COT message and sends it to all active subscribers.
The publish sender must be set either via new or
with_sender before calling this method.
§Errors
Returns an std::io::Error if:
- The publish sender has not been configured
- The mpsc channel fails to send (all receivers dropped)
- The mpsc channel is full (should not happen with sufficient buffer size)
Sourcepub async fn publish_checked(&self) -> Result<(), PublishError>
pub async fn publish_checked(&self) -> Result<(), PublishError>
Publishes this COT message to all subscribers via the mpsc channel and waits for confirmation of the COT being sent
§Errors
Returns an std::io::Error if:
- The publish sender has not been configured
- The mpsc channel fails to send (all receivers dropped)
- The mpsc channel is full (should not happen with sufficient buffer size)
Sourcepub fn set_contact(&mut self, callsign: Option<&str>, endpoint: Option<&str>)
pub fn set_contact(&mut self, callsign: Option<&str>, endpoint: Option<&str>)
Sets or clears the contact information for this COT entity
If both callsign and endpoint are None, the contact is cleared.
§Arguments
callsign- Optional human-readable callsign or identifierendpoint- Optional network endpoint (IP address, hostname, etc.)
Sourcepub fn set_xml_detail(&mut self, xml_detail: Option<&str>)
pub fn set_xml_detail(&mut self, xml_detail: Option<&str>)
Sets or clears the XML detail block for this COT message
The XML detail block can contain additional COT-specific data in XML format.
§Arguments
xml_detail- Optional XML string containing additional COT detail information
Sourcepub fn set_position(&mut self, lat: f64, lng: f64)
pub fn set_position(&mut self, lat: f64, lng: f64)
Sets the basic position (latitude and longitude) for this COT entity
If a position already exists, only the latitude and longitude are updated.
Otherwise, creates a new position with hae, ce, and le set to 0.0.
§Arguments
lat- Latitude in decimal degrees (WGS-84)lng- Longitude in decimal degrees (WGS-84)
Sourcepub fn set_altitude(&mut self, hae: f64)
pub fn set_altitude(&mut self, hae: f64)
Sets the altitude (height above ellipsoid) for this COT entity
If a position already exists, only the altitude is updated.
Otherwise, creates a new position with lat, lng, ce, and le set to 0.0.
§Arguments
hae- Height Above Ellipsoid in meters (WGS-84)
Sourcepub fn set_position_extended(
&mut self,
lat: f64,
lng: f64,
hae: f64,
ce: f64,
le: f64,
)
pub fn set_position_extended( &mut self, lat: f64, lng: f64, hae: f64, ce: f64, le: f64, )
Sets the complete position including altitude and accuracy for this COT entity
Creates or replaces the position with all fields specified.
§Arguments
lat- Latitude in decimal degrees (WGS-84)lng- Longitude in decimal degrees (WGS-84)hae- Height Above Ellipsoid in meters (WGS-84)ce- Circular Error - horizontal position accuracy in meters (90% confidence)le- Linear Error - vertical position accuracy in meters (90% confidence)
Sourcepub fn set_precision_location(
&mut self,
geopointsrc: Option<&str>,
altsrc: Option<&str>,
)
pub fn set_precision_location( &mut self, geopointsrc: Option<&str>, altsrc: Option<&str>, )
Sets or clears the precision location metadata for this COT entity
If both geopointsrc and altsrc are None, the precision location is cleared.
§Arguments
geopointsrc- Optional geopoint source (e.g., “GPS”, “USER”, “CALCULATED”)altsrc- Optional altitude source (e.g., “GPS”, “BARO”, “USER”)