pub struct Instant {
pub seconds: u64,
pub nanos: u32,
}Fields§
§seconds: u64The number of seconds since the unix epoch.
nanos: u32Implementations§
Source§impl Instant
impl Instant
pub fn duration_until_midnight(self) -> Duration
pub fn into_date(self) -> Date
pub fn from_utc_datetime(value: DateTime<Utc>) -> Self
pub fn from_timestamp(seconds: i64) -> Self
pub fn into_utc_datetime(self) -> DateTime<Utc>
pub fn subtract_minutes(self, value: u64) -> Self
pub fn add_minutes(self, value: u64) -> 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
Source§impl From<SystemTime> for Instant
impl From<SystemTime> for Instant
Source§fn from(value: SystemTime) -> Self
fn from(value: SystemTime) -> Self
Converts to this type from the input type.
Source§impl Ord for Instant
impl Ord for Instant
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
Source§impl PartialOrd for Instant
impl PartialOrd for Instant
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 UnsafeUnpin 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