pub enum Time {
SecIndex(u32),
Timestamp(u32),
LocalTimestamp {
timestamp: u32,
local_offset_minutes: i16,
season_offset_minutes: i16,
},
}Expand description
A point in time as SML encodes it: SML_Time.
Variants§
SecIndex(u32)
Seconds since an arbitrary, device-specific epoch (often power-up).
Timestamp(u32)
Seconds since 1970-01-01T00:00:00Z.
LocalTimestamp
A UTC timestamp with the local offsets the device applied.
Implementations§
Trait Implementations§
impl Copy for Time
Source§impl Display for Time
Timestamps as ISO 8601: 2023-11-14T22:13:20Z, or local wall time with its offset
(2023-11-14T23:13:20+01:00); a seconds index as secIndex 42 s.
impl Display for Time
Timestamps as ISO 8601: 2023-11-14T22:13:20Z, or local wall time with its offset
(2023-11-14T23:13:20+01:00); a seconds index as secIndex 42 s.
use sml_kit::Time;
assert_eq!(Time::Timestamp(1_700_000_000).to_string(), "2023-11-14T22:13:20Z");
let local = Time::LocalTimestamp { timestamp: 1_700_000_000, local_offset_minutes: 60, season_offset_minutes: 0 };
assert_eq!(local.to_string(), "2023-11-14T23:13:20+01:00");impl Eq for Time
impl StructuralPartialEq for Time
Auto Trait Implementations§
impl Forget for Time
impl Freeze for Time
impl Move for Time
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnsafeUnpin for Time
impl UnwindSafe for Time
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