pub struct Instant { /* private fields */ }
Expand description
Represents a point in time (UTC):
- seconds: number of seconds since the Unix epoch (1970-01-01T00:00:00Z)
- nanos: number of nanoseconds since the last second
Implementations§
Source§impl Instant
impl Instant
Sourcepub fn new(seconds: u64, nanos: u32) -> Self
pub fn new(seconds: u64, nanos: u32) -> Self
Create a new Instant
from the given number of seconds and nanoseconds.
- seconds: number of seconds since the Unix epoch (1970-01-01T00:00:00Z)
- nanos: number of nanoseconds since the last second
§Panics
if the number of seconds would overflow when converted to nanoseconds.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Instant
impl<'de> Deserialize<'de> for Instant
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Instant> for SystemTime
impl From<Instant> for SystemTime
Source§impl From<SystemTime> for Instant
impl From<SystemTime> for Instant
Source§fn from(time: SystemTime) -> Self
fn from(time: SystemTime) -> Self
Converts to this type from the input type.
impl Copy for Instant
impl Eq for Instant
impl StructuralPartialEq for Instant
Auto Trait Implementations§
impl Freeze for Instant
impl RefUnwindSafe for Instant
impl Send for Instant
impl Sync for Instant
impl Unpin for Instant
impl UnwindSafe for Instant
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