pub struct HumanDuration(pub Duration);Expand description
Strongly-typed record duration wrapper around chrono::Duration.
Supports deserialization from:
- “1500ms”
- “30s”
- “5m”
- “1h”
Fractional seconds like 0.5 are rejected. Negative or zero durations are rejected.
Tuple Fields§
§0: DurationTrait Implementations§
Source§impl Clone for HumanDuration
impl Clone for HumanDuration
Source§fn clone(&self) -> HumanDuration
fn clone(&self) -> HumanDuration
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HumanDuration
impl Debug for HumanDuration
Source§impl<'de> Deserialize<'de> for HumanDuration
impl<'de> Deserialize<'de> for HumanDuration
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 Ord for HumanDuration
impl Ord for HumanDuration
Source§fn cmp(&self, other: &HumanDuration) -> Ordering
fn cmp(&self, other: &HumanDuration) -> Ordering
1.21.0 · 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 PartialEq for HumanDuration
impl PartialEq for HumanDuration
Source§impl PartialOrd for HumanDuration
impl PartialOrd for HumanDuration
impl Copy for HumanDuration
impl Eq for HumanDuration
impl StructuralPartialEq for HumanDuration
Auto Trait Implementations§
impl Freeze for HumanDuration
impl RefUnwindSafe for HumanDuration
impl Send for HumanDuration
impl Sync for HumanDuration
impl Unpin for HumanDuration
impl UnwindSafe for HumanDuration
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