#[repr(C)]pub struct UnsafeTime {
pub sec: i32,
pub nanosec: u32,
}Expand description
Represents a timestamp 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.
This is compatible with ROS2’s builtin_interfaces/Time.
Fields§
§sec: i32Seconds since UNIX epoch.
nanosec: u32Nanoseconds component (0-999999999).
Implementations§
Source§impl UnsafeTime
impl UnsafeTime
Sourcepub const fn new(sec: i32, nanosec: u32) -> UnsafeTime
pub const fn new(sec: i32, nanosec: u32) -> UnsafeTime
Creates a new UnsafeTime instance.
Sourcepub const fn zero() -> UnsafeTime
pub const fn zero() -> UnsafeTime
Creates an UnsafeTime representing the UNIX epoch (0 seconds).
Trait Implementations§
Source§impl Clone for UnsafeTime
impl Clone for UnsafeTime
Source§fn clone(&self) -> UnsafeTime
fn clone(&self) -> UnsafeTime
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 UnsafeTime
impl Debug for UnsafeTime
Source§impl Default for UnsafeTime
impl Default for UnsafeTime
Source§fn default() -> UnsafeTime
fn default() -> UnsafeTime
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UnsafeTime
impl<'de> Deserialize<'de> for UnsafeTime
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UnsafeTime, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UnsafeTime, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&SystemTime> for UnsafeTime
impl From<&SystemTime> for UnsafeTime
Source§fn from(t: &SystemTime) -> UnsafeTime
fn from(t: &SystemTime) -> UnsafeTime
Converts to this type from the input type.
Source§impl From<SystemTime> for UnsafeTime
impl From<SystemTime> for UnsafeTime
Source§fn from(t: SystemTime) -> UnsafeTime
fn from(t: SystemTime) -> UnsafeTime
Converts to this type from the input type.
Source§impl Ord for UnsafeTime
impl Ord for UnsafeTime
Source§fn cmp(&self, other: &UnsafeTime) -> Ordering
fn cmp(&self, other: &UnsafeTime) -> 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 UnsafeTime
impl PartialEq for UnsafeTime
Source§impl PartialOrd for UnsafeTime
impl PartialOrd for UnsafeTime
Source§impl Serialize for UnsafeTime
impl Serialize for UnsafeTime
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 UnsafeTime
impl Eq for UnsafeTime
impl StructuralPartialEq for UnsafeTime
Auto Trait Implementations§
impl Freeze for UnsafeTime
impl RefUnwindSafe for UnsafeTime
impl Send for UnsafeTime
impl Sync for UnsafeTime
impl Unpin for UnsafeTime
impl UnsafeUnpin for UnsafeTime
impl UnwindSafe for UnsafeTime
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