Struct datetime::Duration [−][src]
A duration is a length of time on the timeline, irrespective of time zone or calendar format, with millisecond precision.
Implementations
impl Duration
[src]
pub fn zero() -> Self
[src]
Create a new zero-length duration.
pub fn of(seconds: i64) -> Self
[src]
Create a new duration that’s the given number of seconds long.
pub fn of_ms(seconds: i64, milliseconds: i16) -> Self
[src]
Create a new duration that’s the given number of seconds and milliseconds long.
pub fn lengths(&self) -> (i64, i16)
[src]
Return the seconds and milliseconds portions of the duration as a 2-element tuple.
Trait Implementations
impl Add<Duration> for LocalDateTime
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, duration: Duration) -> Self
[src]
impl Add<Duration> for Duration
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self
[src]
impl Add<Duration> for Instant
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, duration: Duration) -> Self
[src]
impl Clone for Duration
[src]
impl Copy for Duration
[src]
impl Debug for Duration
[src]
impl Eq for Duration
[src]
impl Mul<i64> for Duration
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, amount: i64) -> Self
[src]
impl PartialEq<Duration> for Duration
[src]
impl StructuralEq for Duration
[src]
impl StructuralPartialEq for Duration
[src]
impl Sub<Duration> for LocalDateTime
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, duration: Duration) -> Self
[src]
impl Sub<Duration> for Duration
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self
[src]
impl Sub<Duration> for Instant
[src]
Auto Trait Implementations
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnwindSafe for Duration
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,