Struct tor_units::IntegerMinutes
source · pub struct IntegerMinutes<T> { /* private fields */ }
Expand description
This type represents an integer number of minutes.
The underlying type should usually implement TryInto<u64>
.
Implementations§
source§impl<T> IntegerMinutes<T>
impl<T> IntegerMinutes<T>
sourcepub fn as_minutes(self) -> T
pub fn as_minutes(self) -> T
Deconstructor
Use only in contexts where it’s no longer possible to use the Rust type system to ensure secs vs ms vs us correctness.
sourcepub fn try_map<U, F, E>(self, f: F) -> Result<IntegerMinutes<U>, E>
pub fn try_map<U, F, E>(self, f: F) -> Result<IntegerMinutes<U>, E>
Map the inner value (useful for conversion)
use tor_units::{BoundedInt32, IntegerMinutes};
let value: IntegerMinutes<i32> = 42.into();
let value: IntegerMinutes<BoundedInt32<0,1000>>
= value.try_map(TryInto::try_into).unwrap();
Trait Implementations§
source§impl<T: Clone> Clone for IntegerMinutes<T>
impl<T: Clone> Clone for IntegerMinutes<T>
source§fn clone(&self) -> IntegerMinutes<T>
fn clone(&self) -> IntegerMinutes<T>
Returns a copy 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<T: Debug> Debug for IntegerMinutes<T>
impl<T: Debug> Debug for IntegerMinutes<T>
source§impl<T> Display for IntegerMinutes<T>where
T: Display,
impl<T> Display for IntegerMinutes<T>where
T: Display,
source§impl<T> From<T> for IntegerMinutes<T>
impl<T> From<T> for IntegerMinutes<T>
source§fn from(original: T) -> IntegerMinutes<T>
fn from(original: T) -> IntegerMinutes<T>
Converts to this type from the input type.
source§impl<T: FromStr> FromStr for IntegerMinutes<T>
impl<T: FromStr> FromStr for IntegerMinutes<T>
source§impl<T: Hash> Hash for IntegerMinutes<T>
impl<T: Hash> Hash for IntegerMinutes<T>
source§impl<T: Ord> Ord for IntegerMinutes<T>
impl<T: Ord> Ord for IntegerMinutes<T>
source§fn cmp(&self, other: &IntegerMinutes<T>) -> Ordering
fn cmp(&self, other: &IntegerMinutes<T>) -> 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<T: PartialEq> PartialEq for IntegerMinutes<T>
impl<T: PartialEq> PartialEq for IntegerMinutes<T>
source§fn eq(&self, other: &IntegerMinutes<T>) -> bool
fn eq(&self, other: &IntegerMinutes<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: PartialOrd> PartialOrd for IntegerMinutes<T>
impl<T: PartialOrd> PartialOrd for IntegerMinutes<T>
source§fn partial_cmp(&self, other: &IntegerMinutes<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &IntegerMinutes<T>) -> Option<Ordering>
1.0.0 · source§fn 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 moresource§impl<const H: i32, const L: i32> TryFrom<i32> for IntegerMinutes<BoundedInt32<H, L>>
impl<const H: i32, const L: i32> TryFrom<i32> for IntegerMinutes<BoundedInt32<H, L>>
impl<T: Copy> Copy for IntegerMinutes<T>
impl<T: Eq> Eq for IntegerMinutes<T>
impl<T> StructuralPartialEq for IntegerMinutes<T>
Auto Trait Implementations§
impl<T> Freeze for IntegerMinutes<T>where
T: Freeze,
impl<T> RefUnwindSafe for IntegerMinutes<T>where
T: RefUnwindSafe,
impl<T> Send for IntegerMinutes<T>where
T: Send,
impl<T> Sync for IntegerMinutes<T>where
T: Sync,
impl<T> Unpin for IntegerMinutes<T>where
T: Unpin,
impl<T> UnwindSafe for IntegerMinutes<T>where
T: 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