Struct humanize_rs::time::Time
source · pub struct Time { /* private fields */ }
Expand description
Represents a time in range [0000-01-01T00:00:00Z, 10000-01-01T00:00:00Z)
Implementations
sourceimpl Time
impl Time
sourcepub const UNIX_EPOCH: Time = UNIX_EPOCH
pub const UNIX_EPOCH: Time = UNIX_EPOCH
Represents 1970-01-01 00:00:00Z
sourcepub fn from_timetuple(
year: u32,
month: u32,
day: u32,
hour: u32,
minute: u32,
second: u32,
nano: u32,
timezone: TimeZone
) -> Option<Time>
pub fn from_timetuple(
year: u32,
month: u32,
day: u32,
hour: u32,
minute: u32,
second: u32,
nano: u32,
timezone: TimeZone
) -> Option<Time>
Returns a Time with the given time tuple
sourcepub fn to_system_time(&self) -> Option<SystemTime>
pub fn to_system_time(&self) -> Option<SystemTime>
Convert the time to SystemTime, returns None if the time is before unix epoch
Trait Implementations
sourceimpl Ord for Time
impl Ord for Time
1.21.0 · sourcefn 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
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Time> for Time
impl PartialOrd<Time> for Time
sourcefn partial_cmp(&self, other: &Time) -> Option<Ordering>
fn partial_cmp(&self, other: &Time) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Time
impl StructuralEq for Time
impl StructuralPartialEq for Time
Auto Trait Implementations
impl RefUnwindSafe for Time
impl Send for Time
impl Sync for Time
impl Unpin for Time
impl UnwindSafe for Time
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more