Struct icu::experimental::duration::Duration
source · pub struct Duration {
pub sign: DurationSign,
pub years: u64,
pub months: u64,
pub weeks: u64,
pub days: u64,
pub hours: u64,
pub minutes: u64,
pub seconds: u64,
pub milliseconds: u64,
pub microseconds: u64,
pub nanoseconds: u64,
}
Expand description
Represents a duration of time (intuitively, how long something took / will take).
Can be constructed ergonomically using the Default
trait like so:
let d = Duration {
years: 1,
months: 2,
weeks: 3,
..Default::default()
};
Fields§
§sign: DurationSign
Whether the duration is positive.
years: u64
The number of years in the duration.
months: u64
The number of months in the duration.
weeks: u64
The number of weeks in the duration.
days: u64
The number of days in the duration.
hours: u64
The number of hours in the duration.
minutes: u64
The number of minutes in the duration.
seconds: u64
The number of seconds in the duration.
milliseconds: u64
The number of milliseconds in the duration.
microseconds: u64
The number of microseconds in the duration.
nanoseconds: u64
The number of nanoseconds in the duration.
Implementations§
Trait Implementations§
source§impl Ord for Duration
impl Ord for Duration
source§impl PartialOrd for Duration
impl PartialOrd for Duration
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 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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