pub struct Duration { /* private fields */ }Expand description
A duration value representing a duration between two points in time.
Implementations§
Source§impl Duration
impl Duration
pub fn new(months: i32, days: i32, nanos: i64) -> Self
pub fn from_seconds(seconds: i64) -> Self
pub fn from_milliseconds(milliseconds: i64) -> Self
pub fn from_microseconds(microseconds: i64) -> Self
pub fn from_nanoseconds(nanoseconds: i64) -> Self
pub fn from_minutes(minutes: i64) -> Self
pub fn from_hours(hours: i64) -> Self
pub fn from_days(days: i64) -> Self
pub fn from_weeks(weeks: i64) -> Self
pub fn from_months(months: i64) -> Self
pub fn from_years(years: i64) -> Self
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 is_positive(&self) -> bool
pub fn is_negative(&self) -> bool
pub fn abs(&self) -> Self
pub fn negate(&self) -> Self
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
Source§impl PartialOrd for Duration
impl PartialOrd for Duration
Source§impl TryFromValue for Duration
impl TryFromValue for Duration
Source§fn try_from_value(value: &Value) -> Result<Self, FromValueError>
fn try_from_value(value: &Value) -> Result<Self, FromValueError>
Attempt to extract a value of this type from a Value. Read more
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 UnwindSafe for Duration
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)