pub struct LocalDuration(/* private fields */);
Expand description
Time duration as measured locally.
Implementations§
Source§impl LocalDuration
impl LocalDuration
Sourcepub const BLOCK_INTERVAL: LocalDuration
pub const BLOCK_INTERVAL: LocalDuration
The time interval between blocks. The “block time”.
Sourcepub const MAX: LocalDuration
pub const MAX: LocalDuration
Maximum duration.
Sourcepub const fn from_secs(secs: u64) -> LocalDuration
pub const fn from_secs(secs: u64) -> LocalDuration
Create a new duration from whole seconds.
Sourcepub const fn from_mins(mins: u64) -> LocalDuration
pub const fn from_mins(mins: u64) -> LocalDuration
Create a new duration from whole minutes.
Sourcepub const fn from_millis(millis: u128) -> LocalDuration
pub const fn from_millis(millis: u128) -> LocalDuration
Construct a new duration from milliseconds.
Trait Implementations§
Source§impl Add<LocalDuration> for LocalTime
Add a duration to a local time. Yields a local time.
impl Add<LocalDuration> for LocalTime
Add a duration to a local time. Yields a local time.
Source§impl Add for LocalDuration
impl Add for LocalDuration
Source§type Output = LocalDuration
type Output = LocalDuration
The resulting type after applying the
+
operator.Source§fn add(self, other: LocalDuration) -> LocalDuration
fn add(self, other: LocalDuration) -> LocalDuration
Performs the
+
operation. Read moreSource§impl Clone for LocalDuration
impl Clone for LocalDuration
Source§fn clone(&self) -> LocalDuration
fn clone(&self) -> LocalDuration
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LocalDuration
impl Debug for LocalDuration
Source§impl<'de> Deserialize<'de> for LocalDuration
impl<'de> Deserialize<'de> for LocalDuration
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LocalDuration, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LocalDuration, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for LocalDuration
impl Display for LocalDuration
Source§impl Div<u32> for LocalDuration
impl Div<u32> for LocalDuration
Source§type Output = LocalDuration
type Output = LocalDuration
The resulting type after applying the
/
operator.Source§impl Mul<u64> for LocalDuration
impl Mul<u64> for LocalDuration
Source§type Output = LocalDuration
type Output = LocalDuration
The resulting type after applying the
*
operator.Source§impl Ord for LocalDuration
impl Ord for LocalDuration
Source§fn cmp(&self, other: &LocalDuration) -> Ordering
fn cmp(&self, other: &LocalDuration) -> Ordering
1.21.0 · 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
Source§impl PartialEq for LocalDuration
impl PartialEq for LocalDuration
Source§impl PartialOrd for LocalDuration
impl PartialOrd for LocalDuration
Source§impl Serialize for LocalDuration
impl Serialize for LocalDuration
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl Sub<LocalDuration> for LocalTime
Substract a duration from a local time. Yields a local time.
impl Sub<LocalDuration> for LocalTime
Substract a duration from a local time. Yields a local time.
Source§impl<'a> Sum<&'a LocalDuration> for LocalDuration
impl<'a> Sum<&'a LocalDuration> for LocalDuration
Source§fn sum<I>(iter: I) -> LocalDurationwhere
I: Iterator<Item = &'a LocalDuration>,
fn sum<I>(iter: I) -> LocalDurationwhere
I: Iterator<Item = &'a LocalDuration>,
Takes an iterator and generates
Self
from the elements by “summing up”
the items.impl Copy for LocalDuration
impl Eq for LocalDuration
impl StructuralPartialEq for LocalDuration
Auto Trait Implementations§
impl Freeze for LocalDuration
impl RefUnwindSafe for LocalDuration
impl Send for LocalDuration
impl Sync for LocalDuration
impl Unpin for LocalDuration
impl UnwindSafe for LocalDuration
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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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