CursorOnTarget

Struct CursorOnTarget 

Source
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: u64

Time in milliseconds after which this COT message should be considered stale

§uid: String

Unique identifier for this COT entity

§contact: Option<Contact>

Contact information including callsign and endpoint

§type: String

COT 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: String

How this COT was generated (e.g., “m-g” for machine-generated)

§access: String

Access restrictions for this COT message

§qos: String

Quality of service level

§opex: String

Operational expertise or operational context

Implementations§

Source§

impl CursorOnTarget

Source

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 entity
  • r#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
Source

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)
Source

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)
Source

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 identifier
  • endpoint - Optional network endpoint (IP address, hostname, etc.)
Source

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
Source

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)
Source

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)
Source

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)
Source

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”)
Source

pub fn set_uid(&mut self, uid: &str)

Sets the unique identifier (UID) for this COT entity

§Arguments
  • uid - Unique identifier string

Trait Implementations§

Source§

impl Clone for CursorOnTarget

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CursorOnTarget

Source§

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

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

impl Default for CursorOnTarget

Source§

fn default() -> CursorOnTarget

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.