pub struct Duration(/* private fields */);Expand description
A length of time, ordered by length.
Implementations§
Source§impl Duration
impl Duration
Sourcepub fn from_seconds(seconds: Decimal) -> Duration
pub fn from_seconds(seconds: Decimal) -> Duration
Returns the duration of seconds seconds.
Sourcepub fn from_millis(count: &Int) -> Duration
pub fn from_millis(count: &Int) -> Duration
Returns the duration of count milliseconds (duration.millis).
§Panics
Never: normalizing a count scaled by 10^-3 only raises its exponent
towards zero, which cannot pass i64::MAX.
Trait Implementations§
Source§impl Display for Duration
The text form: PT, the seconds as a Decimal’s text, then S, as
abi.md’s canonical ISO 8601 form writes it: PT90S, PT0.25S, PT-5S.
impl Display for Duration
The text form: PT, the seconds as a Decimal’s text, then S, as
abi.md’s canonical ISO 8601 form writes it: PT90S, PT0.25S, PT-5S.
impl Eq for Duration
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Duration
impl PartialOrd for Duration
Source§impl Shaped for Duration
impl Shaped for Duration
Source§fn write_at(
&self,
out: &mut ValueWriter<'_, '_>,
ty: &Type,
) -> Result<(), EncodeError>
fn write_at( &self, out: &mut ValueWriter<'_, '_>, ty: &Type, ) -> Result<(), EncodeError>
Source§fn read_at(
input: &mut ValueReader<'_, '_, '_>,
ty: &Type,
) -> Result<Duration, DecodeError>
fn read_at( input: &mut ValueReader<'_, '_, '_>, ty: &Type, ) -> Result<Duration, DecodeError>
impl StructuralPartialEq for Duration
Auto Trait Implementations§
impl Forget for Duration
impl Freeze for Duration
impl Move for Duration
impl RefUnwindSafe for Duration
impl Send for Durationwhere
RawVecInner: Send,
impl Sync for Durationwhere
RawVecInner: Sync,
impl Unpin for Duration
impl UnsafeUnpin for Duration
impl UnwindSafe for Durationwhere
RawVecInner: UnwindSafe,
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