pub struct Duration {
pub days: Option<u64>,
pub hours: Option<u64>,
pub minutes: Option<u64>,
pub seconds: Option<u64>,
pub milliseconds: Option<u64>,
}Expand description
Represents a duration
Fields§
§days: Option<u64>Gets/sets the number of days, if any
hours: Option<u64>Gets/sets the number of hours, if any
minutes: Option<u64>Gets/sets the number of minutes, if any
seconds: Option<u64>Gets/sets the number of seconds, if any
milliseconds: Option<u64>Gets/sets the number of milliseconds, if any
Implementations§
Source§impl Duration
impl Duration
pub fn from_days(v: u64) -> Self
pub fn from_hours(v: u64) -> Self
pub fn from_minutes(v: u64) -> Self
pub fn from_seconds(v: u64) -> Self
pub fn from_milliseconds(v: u64) -> Self
pub fn total_days(&self) -> f64
pub fn total_hours(&self) -> f64
pub fn total_minutes(&self) -> f64
pub fn total_seconds(&self) -> f64
Sourcepub fn total_milliseconds(&self) -> u64
pub fn total_milliseconds(&self) -> u64
Gets the the duration’s total amount of milliseconds
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
impl Eq 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