#[repr(C)]pub struct UnsafeDuration {
pub sec: i32,
pub nanosec: u32,
}Expand description
Represents a duration that may not be safe across all platforms.
The “Unsafe” prefix indicates this is subject to the year-2038 problem
on 32-bit systems since sec is an i32.
Fields§
§sec: i32Seconds component.
nanosec: u32Nanoseconds component.
Implementations§
Source§impl UnsafeDuration
impl UnsafeDuration
Sourcepub const fn new(sec: i32, nanosec: u32) -> UnsafeDuration
pub const fn new(sec: i32, nanosec: u32) -> UnsafeDuration
Creates a new UnsafeDuration instance.
Sourcepub const fn zero() -> UnsafeDuration
pub const fn zero() -> UnsafeDuration
Creates a zero duration.
Trait Implementations§
Source§impl Clone for UnsafeDuration
impl Clone for UnsafeDuration
Source§fn clone(&self) -> UnsafeDuration
fn clone(&self) -> UnsafeDuration
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UnsafeDuration
impl Debug for UnsafeDuration
Source§impl Default for UnsafeDuration
impl Default for UnsafeDuration
Source§fn default() -> UnsafeDuration
fn default() -> UnsafeDuration
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UnsafeDuration
impl<'de> Deserialize<'de> for UnsafeDuration
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UnsafeDuration, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UnsafeDuration, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&Duration> for UnsafeDuration
impl From<&Duration> for UnsafeDuration
Source§fn from(t: &Duration) -> UnsafeDuration
fn from(t: &Duration) -> UnsafeDuration
Converts to this type from the input type.
Source§impl From<Duration> for UnsafeDuration
impl From<Duration> for UnsafeDuration
Source§fn from(t: Duration) -> UnsafeDuration
fn from(t: Duration) -> UnsafeDuration
Converts to this type from the input type.
Source§impl Ord for UnsafeDuration
impl Ord for UnsafeDuration
Source§fn cmp(&self, other: &UnsafeDuration) -> Ordering
fn cmp(&self, other: &UnsafeDuration) -> Ordering
1.21.0 · 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
Source§impl PartialEq for UnsafeDuration
impl PartialEq for UnsafeDuration
Source§impl PartialOrd for UnsafeDuration
impl PartialOrd for UnsafeDuration
Source§impl Serialize for UnsafeDuration
impl Serialize for UnsafeDuration
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 Copy for UnsafeDuration
impl Eq for UnsafeDuration
impl StructuralPartialEq for UnsafeDuration
Auto Trait Implementations§
impl Freeze for UnsafeDuration
impl RefUnwindSafe for UnsafeDuration
impl Send for UnsafeDuration
impl Sync for UnsafeDuration
impl Unpin for UnsafeDuration
impl UnsafeUnpin for UnsafeDuration
impl UnwindSafe for UnsafeDuration
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