pub struct CdsTime {
pub config: CdsConfig,
pub day: u32,
pub ms_of_day: u32,
pub sub_ms: u32,
}Expand description
A CDS timestamp.
Fields§
§config: CdsConfigEncoding configuration.
day: u32Day count since epoch.
ms_of_day: u32Milliseconds within the day (0..86_399_999).
sub_ms: u32Sub-millisecond value (µs 0..999 or ps 0..999_999_999).
Implementations§
Source§impl CdsTime
impl CdsTime
Sourcepub const fn new(
config: CdsConfig,
day: u32,
ms_of_day: u32,
sub_ms: u32,
) -> Self
pub const fn new( config: CdsConfig, day: u32, ms_of_day: u32, sub_ms: u32, ) -> Self
Creates a new CDS timestamp.
Sourcepub fn from_seconds(config: CdsConfig, seconds: f64) -> Self
pub fn from_seconds(config: CdsConfig, seconds: f64) -> Self
Creates a CDS timestamp from total seconds since epoch.
Sourcepub fn to_seconds(&self) -> f64
pub fn to_seconds(&self) -> f64
Converts to total seconds since epoch.
Sourcepub fn encode(&self, buf: &mut [u8]) -> Result<usize, CdsError>
pub fn encode(&self, buf: &mut [u8]) -> Result<usize, CdsError>
Encodes this timestamp (P-field + T-field).
Sourcepub fn encode_t_field(&self, buf: &mut [u8]) -> Result<usize, CdsError>
pub fn encode_t_field(&self, buf: &mut [u8]) -> Result<usize, CdsError>
Encodes only the T-field (no P-field).
Trait Implementations§
impl Copy for CdsTime
impl Eq for CdsTime
impl StructuralPartialEq for CdsTime
Auto Trait Implementations§
impl Freeze for CdsTime
impl RefUnwindSafe for CdsTime
impl Send for CdsTime
impl Sync for CdsTime
impl Unpin for CdsTime
impl UnsafeUnpin for CdsTime
impl UnwindSafe for CdsTime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more