Struct chrono_humanize::HumanTime
source · pub struct HumanTime(_);
Expand description
Duration
wrapper that helps expressing the duration in human languages
Implementations§
source§impl HumanTime
impl HumanTime
sourcepub fn now() -> Self
pub fn now() -> Self
Create HumanTime
object that corresponds to the current point in time.
. Similar to chrono::Utc::now()
sourcepub fn to_text_en(self, accuracy: Accuracy, tense: Tense) -> String
pub fn to_text_en(self, accuracy: Accuracy, tense: Tense) -> String
Gives English text representation of the HumanTime
with given accuracy
and ’tense`
pub fn is_zero(self) -> bool
Trait Implementations§
source§impl From<SystemTime> for HumanTime
impl From<SystemTime> for HumanTime
source§fn from(st: SystemTime) -> Self
fn from(st: SystemTime) -> Self
Converts to this type from the input type.
source§impl PartialEq<HumanTime> for HumanTime
impl PartialEq<HumanTime> for HumanTime
source§impl PartialOrd<HumanTime> for HumanTime
impl PartialOrd<HumanTime> for HumanTime
1.0.0 · source§fn 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 Copy for HumanTime
impl StructuralPartialEq for HumanTime
Auto Trait Implementations§
impl RefUnwindSafe for HumanTime
impl Send for HumanTime
impl Sync for HumanTime
impl Unpin for HumanTime
impl UnwindSafe for HumanTime
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