pub struct Duration { /* private fields */ }Implementations§
Source§impl Duration
impl Duration
pub fn new(months: i32, days: i32, nanos: i64) -> Result<Self, Box<TypeError>>
pub fn from_seconds(seconds: i64) -> Result<Self, Box<TypeError>>
pub fn from_milliseconds(milliseconds: i64) -> Result<Self, Box<TypeError>>
pub fn from_microseconds(microseconds: i64) -> Result<Self, Box<TypeError>>
pub fn from_nanoseconds(nanoseconds: i64) -> Result<Self, Box<TypeError>>
pub fn from_minutes(minutes: i64) -> Result<Self, Box<TypeError>>
pub fn from_hours(hours: i64) -> Result<Self, Box<TypeError>>
pub fn from_days(days: i64) -> Result<Self, Box<TypeError>>
pub fn from_weeks(weeks: i64) -> Result<Self, Box<TypeError>>
pub fn from_months(months: i64) -> Result<Self, Box<TypeError>>
pub fn from_years(years: i64) -> Result<Self, Box<TypeError>>
pub fn zero() -> Self
pub fn seconds(&self) -> i64
pub fn milliseconds(&self) -> i64
pub fn microseconds(&self) -> i64
pub fn nanoseconds(&self) -> i64
pub fn get_months(&self) -> i32
pub fn get_days(&self) -> i32
pub fn get_nanos(&self) -> i64
pub fn as_nanos(&self) -> i64
pub fn is_positive(&self) -> bool
pub fn is_negative(&self) -> bool
pub fn abs(&self) -> Self
pub fn negate(&self) -> Self
pub fn to_iso_string(&self) -> String
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Duration
impl<'de> Deserialize<'de> for Duration
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 Duration
impl Ord for Duration
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 Duration
impl PartialOrd for Duration
Source§impl TryFromValue for Duration
impl TryFromValue for Duration
fn try_from_value(value: &Value) -> Result<Self, FromValueError>
fn from_value(value: &Value) -> Option<Self>
impl Copy for Duration
impl Eq for Duration
impl IsTemporal for Duration
impl StructuralPartialEq for Duration
Auto Trait Implementations§
impl Freeze for Duration
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnsafeUnpin for Duration
impl UnwindSafe for Duration
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more