pub struct Duration {
pub year: Option<f64>,
pub quarter: Option<f64>,
pub month: Option<f64>,
pub week: Option<f64>,
pub day: Option<f64>,
pub hour: Option<f64>,
pub minute: Option<f64>,
pub second: Option<f64>,
pub millisecond: Option<f64>,
}Expand description
Duration with support for both calendar and clock units.
Fields§
§year: Option<f64>Number of years to add.
quarter: Option<f64>Number of quarters to add.
month: Option<f64>Number of months to add.
week: Option<f64>Number of weeks to add.
day: Option<f64>Number of days to add.
hour: Option<f64>Number of hours to add.
minute: Option<f64>Number of minutes to add.
second: Option<f64>Number of seconds to add.
millisecond: Option<f64>Number of milliseconds to add.
Implementations§
Source§impl Duration
impl Duration
Sourcepub fn has_time_component(&self) -> bool
pub fn has_time_component(&self) -> bool
Return true if the duration contains clock-based units.
Sourcepub fn has_date_component(&self) -> bool
pub fn has_date_component(&self) -> bool
Return true if the duration contains calendar-based units.
Trait Implementations§
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