Struct nakamoto_net::time::LocalDuration
source · pub struct LocalDuration(_);
Expand description
Time duration as measured locally.
Implementations
sourceimpl 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_millis(millis: u128) -> Self
pub const fn from_millis(millis: u128) -> Self
Construct a new duration from milliseconds.
Trait Implementations
sourceimpl Add<LocalDuration> for LocalDuration
impl Add<LocalDuration> for LocalDuration
type Output = LocalDuration
type Output = LocalDuration
The resulting type after applying the
+
operator.sourcefn add(self, other: LocalDuration) -> LocalDuration
fn add(self, other: LocalDuration) -> LocalDuration
Performs the
+
operation. Read moresourceimpl Add<LocalDuration> for LocalTime
impl Add<LocalDuration> for LocalTime
Add a duration to a local time. Yields a local time.
sourceimpl Clone for LocalDuration
impl Clone for LocalDuration
sourcefn clone(&self) -> LocalDuration
fn clone(&self) -> LocalDuration
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for LocalDuration
impl Debug for LocalDuration
sourceimpl Display for LocalDuration
impl Display for LocalDuration
sourceimpl Div<u32> for LocalDuration
impl Div<u32> for LocalDuration
type Output = LocalDuration
type Output = LocalDuration
The resulting type after applying the
/
operator.sourcefn div(self, other: u32) -> LocalDuration
fn div(self, other: u32) -> LocalDuration
Performs the
/
operation. Read moresourceimpl From<LocalDuration> for Duration
impl From<LocalDuration> for Duration
sourcefn from(other: LocalDuration) -> Self
fn from(other: LocalDuration) -> Self
Converts to this type from the input type.
sourceimpl Mul<u64> for LocalDuration
impl Mul<u64> for LocalDuration
type Output = LocalDuration
type Output = LocalDuration
The resulting type after applying the
*
operator.sourcefn mul(self, other: u64) -> LocalDuration
fn mul(self, other: u64) -> LocalDuration
Performs the
*
operation. Read moresourceimpl Ord for LocalDuration
impl Ord for LocalDuration
sourcefn cmp(&self, other: &LocalDuration) -> Ordering
fn cmp(&self, other: &LocalDuration) -> Ordering
1.21.0 · sourcefn 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 · sourcefn 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
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<LocalDuration> for LocalDuration
impl PartialEq<LocalDuration> for LocalDuration
sourcefn eq(&self, other: &LocalDuration) -> bool
fn eq(&self, other: &LocalDuration) -> bool
sourceimpl PartialOrd<LocalDuration> for LocalDuration
impl PartialOrd<LocalDuration> for LocalDuration
sourcefn partial_cmp(&self, other: &LocalDuration) -> Option<Ordering>
fn partial_cmp(&self, other: &LocalDuration) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl Sub<LocalDuration> for LocalTime
impl Sub<LocalDuration> for LocalTime
Substract a duration from a local time. Yields a local time.
sourceimpl<'a> Sum<&'a LocalDuration> for LocalDuration
impl<'a> Sum<&'a LocalDuration> for LocalDuration
sourcefn sum<I: Iterator<Item = &'a LocalDuration>>(iter: I) -> LocalDuration
fn sum<I: Iterator<Item = &'a LocalDuration>>(iter: I) -> LocalDuration
Method which takes an iterator and generates
Self
from the elements by
“summing up” the items. Read moreimpl Copy for LocalDuration
impl Eq for LocalDuration
impl StructuralEq for LocalDuration
impl StructuralPartialEq for LocalDuration
Auto Trait Implementations
impl RefUnwindSafe for LocalDuration
impl Send for LocalDuration
impl Sync for LocalDuration
impl Unpin for LocalDuration
impl UnwindSafe for LocalDuration
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more