pub struct Instant {
pub seconds: u64,
pub nanos: u32,
}
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
Fields§
§seconds: u64
§nanos: u32
Implementations§
Source§impl Instant
impl Instant
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
Errors with TimeError::InvalidDuration
if the number of seconds
would overflow when converted to nanoseconds.
pub fn new(seconds: u64, nanos: u32) -> TimeResult<Self>
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
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