Enum DisTimeStamp

Source
pub enum DisTimeStamp {
    Absolute {
        units_past_the_hour: u32,
        nanoseconds_past_the_hour: u32,
    },
    Relative {
        units_past_the_hour: u32,
        nanoseconds_past_the_hour: u32,
    },
}
Expand description

A timestamp type that models the timestamp mechanism as described in the DIS standard (section 6.2.88 Timestamp). This timestamp interprets an u32 value as an Absolute or a Relative timestamp based on the Least Significant Bit. The remaining (upper) bits represent the units of time passed since the beginning of the current hour in the selected time reference. The DisTimeStamp stores both the units past the hour, and a conversion to nanoseconds past the hour.

Variants§

§

Absolute

Fields

§units_past_the_hour: u32
§nanoseconds_past_the_hour: u32
§

Relative

Fields

§units_past_the_hour: u32
§nanoseconds_past_the_hour: u32

Implementations§

Source§

impl DisTimeStamp

Source

pub fn new_absolute_from_secs(seconds_past_the_hour: u32) -> Self

Source

pub fn new_relative_from_secs(seconds_past_the_hour: u32) -> Self

Source

pub fn new_absolute_from_units(units_past_the_hour: u32) -> Self

Source

pub fn new_relative_from_units(units_past_the_hour: u32) -> Self

Trait Implementations§

Source§

impl Debug for DisTimeStamp

Source§

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

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

impl From<DisTimeStamp> for TimeStamp

Source§

fn from(value: DisTimeStamp) -> Self

Converts to this type from the input type.
Source§

impl From<DisTimeStamp> for u32

Source§

fn from(value: DisTimeStamp) -> Self

Converts to this type from the input type.
Source§

impl From<TimeStamp> for DisTimeStamp

Source§

fn from(value: TimeStamp) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for DisTimeStamp

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.

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> 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, 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.