pub struct InstantBridge {
pub secs: i64,
pub nanos: u32,
}Expand description
Re-export the T71 bridge types so consumers can use them without
qualifying through record::.
Lightweight nanosecond-resolution instant bridge (T71).
Fields§
§secs: i64Unix seconds
nanos: u32Nanoseconds within the second (0–999,999,999)
Implementations§
Source§impl InstantBridge
impl InstantBridge
Sourcepub fn unix(secs: i64, nanos: u32) -> InstantBridge
pub fn unix(secs: i64, nanos: u32) -> InstantBridge
Create a Unix instant from seconds + nanoseconds.
Sourcepub fn to_unix_secs(&self) -> i64
pub fn to_unix_secs(&self) -> i64
Project to Unix seconds (drops sub-second precision).
Sourcepub fn to_unix_nanos(&self) -> i64
pub fn to_unix_nanos(&self) -> i64
Project to Unix nanoseconds.
Sourcepub fn from_coarse(unix_secs: u32) -> InstantBridge
pub fn from_coarse(unix_secs: u32) -> InstantBridge
Convert from a coarse u32 Unix timestamp.
Sourcepub fn duration_since(&self, earlier: &InstantBridge) -> DurationBridge
pub fn duration_since(&self, earlier: &InstantBridge) -> DurationBridge
The duration between two instants: self - earlier.
Sourcepub fn add_duration(&self, d: &DurationBridge) -> InstantBridge
pub fn add_duration(&self, d: &DurationBridge) -> InstantBridge
Add a duration to this instant.
Sourcepub fn sub_duration(&self, d: &DurationBridge) -> InstantBridge
pub fn sub_duration(&self, d: &DurationBridge) -> InstantBridge
Subtract a duration from this instant.
Sourcepub fn is_before(&self, other: &InstantBridge) -> bool
pub fn is_before(&self, other: &InstantBridge) -> bool
Whether this instant is before another.
Sourcepub fn is_after(&self, other: &InstantBridge) -> bool
pub fn is_after(&self, other: &InstantBridge) -> bool
Whether this instant is after another.
Sourcepub fn min(self, other: InstantBridge) -> InstantBridge
pub fn min(self, other: InstantBridge) -> InstantBridge
The earlier of two instants.
Sourcepub fn max(self, other: InstantBridge) -> InstantBridge
pub fn max(self, other: InstantBridge) -> InstantBridge
The later of two instants.
Trait Implementations§
Source§impl Clone for InstantBridge
impl Clone for InstantBridge
Source§fn clone(&self) -> InstantBridge
fn clone(&self) -> InstantBridge
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for InstantBridge
Source§impl Debug for InstantBridge
impl Debug for InstantBridge
Source§impl Default for InstantBridge
impl Default for InstantBridge
Source§fn default() -> InstantBridge
fn default() -> InstantBridge
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for InstantBridge
impl<'de> Deserialize<'de> for InstantBridge
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<InstantBridge, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<InstantBridge, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for InstantBridge
Source§impl Hash for InstantBridge
impl Hash for InstantBridge
Source§impl Ord for InstantBridge
impl Ord for InstantBridge
Source§fn cmp(&self, other: &InstantBridge) -> Ordering
fn cmp(&self, other: &InstantBridge) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for InstantBridge
impl PartialEq for InstantBridge
Source§impl PartialOrd for InstantBridge
impl PartialOrd for InstantBridge
Source§impl Serialize for InstantBridge
impl Serialize for InstantBridge
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for InstantBridge
Auto Trait Implementations§
impl Freeze for InstantBridge
impl RefUnwindSafe for InstantBridge
impl Send for InstantBridge
impl Sync for InstantBridge
impl Unpin for InstantBridge
impl UnsafeUnpin for InstantBridge
impl UnwindSafe for InstantBridge
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