pub struct Seconds<T = u32>(pub T)
where
T: TimeInt;Expand description
A duration unit type
Tuple Fields§
§0: TImplementations§
Trait Implementations§
Source§impl<T> Duration for Seconds<T>where
T: TimeInt,
impl<T> Duration for Seconds<T>where
T: TimeInt,
Source§fn to_generic<DestInt>(
self,
scaling_factor: Fraction,
) -> Result<Generic<DestInt>, ConversionError>
fn to_generic<DestInt>( self, scaling_factor: Fraction, ) -> Result<Generic<DestInt>, ConversionError>
Source§fn to_rate<Rate>(&self) -> Result<Rate, ConversionError>
fn to_rate<Rate>(&self) -> Result<Rate, ConversionError>
Source§impl<T> FixedPoint for Seconds<T>where
T: TimeInt,
impl<T> FixedPoint for Seconds<T>where
T: TimeInt,
Source§const SCALING_FACTOR: Fraction
const SCALING_FACTOR: Fraction
The fractional scaling factor
Source§fn checked_mul(&self, rhs: &Self::T) -> Option<Self>
fn checked_mul(&self, rhs: &Self::T) -> Option<Self>
Multiply with overflow checking
Source§fn checked_div(&self, rhs: &Self::T) -> Option<Self>
fn checked_div(&self, rhs: &Self::T) -> Option<Self>
Multiply with overflow checking
Source§impl<T> From<Microseconds<T>> for Seconds<T>where
T: TimeInt,
impl<T> From<Microseconds<T>> for Seconds<T>where
T: TimeInt,
Source§fn from(small: Microseconds<T>) -> Seconds<T>
fn from(small: Microseconds<T>) -> Seconds<T>
Source§impl<T> From<Milliseconds<T>> for Seconds<T>where
T: TimeInt,
impl<T> From<Milliseconds<T>> for Seconds<T>where
T: TimeInt,
Source§fn from(small: Milliseconds<T>) -> Seconds<T>
fn from(small: Milliseconds<T>) -> Seconds<T>
Source§impl<T> From<Nanoseconds<T>> for Seconds<T>where
T: TimeInt,
impl<T> From<Nanoseconds<T>> for Seconds<T>where
T: TimeInt,
Source§fn from(small: Nanoseconds<T>) -> Seconds<T>
fn from(small: Nanoseconds<T>) -> Seconds<T>
Source§impl<T> Ord for Seconds<T>
impl<T> Ord for Seconds<T>
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, RhsInt> PartialEq<Microseconds<RhsInt>> for Seconds<T>
impl<T, RhsInt> PartialEq<Microseconds<RhsInt>> for Seconds<T>
Source§impl<T, RhsInt> PartialEq<Milliseconds<RhsInt>> for Seconds<T>
impl<T, RhsInt> PartialEq<Milliseconds<RhsInt>> for Seconds<T>
Source§impl<T, RhsInt> PartialEq<Nanoseconds<RhsInt>> for Seconds<T>
impl<T, RhsInt> PartialEq<Nanoseconds<RhsInt>> for Seconds<T>
Source§impl<T, RhsInt> PartialEq<Seconds<RhsInt>> for Microseconds<T>
impl<T, RhsInt> PartialEq<Seconds<RhsInt>> for Microseconds<T>
Source§impl<T, RhsInt> PartialEq<Seconds<RhsInt>> for Milliseconds<T>
impl<T, RhsInt> PartialEq<Seconds<RhsInt>> for Milliseconds<T>
Source§impl<T, RhsInt> PartialEq<Seconds<RhsInt>> for Nanoseconds<T>
impl<T, RhsInt> PartialEq<Seconds<RhsInt>> for Nanoseconds<T>
Source§impl<T, RhsInt> PartialOrd<Hours<RhsInt>> for Seconds<T>
impl<T, RhsInt> PartialOrd<Hours<RhsInt>> for Seconds<T>
Source§impl<T, RhsInt> PartialOrd<Microseconds<RhsInt>> for Seconds<T>
impl<T, RhsInt> PartialOrd<Microseconds<RhsInt>> for Seconds<T>
Source§impl<T, RhsInt> PartialOrd<Milliseconds<RhsInt>> for Seconds<T>
impl<T, RhsInt> PartialOrd<Milliseconds<RhsInt>> for Seconds<T>
Source§impl<T, RhsInt> PartialOrd<Minutes<RhsInt>> for Seconds<T>
impl<T, RhsInt> PartialOrd<Minutes<RhsInt>> for Seconds<T>
Source§impl<T, RhsInt> PartialOrd<Nanoseconds<RhsInt>> for Seconds<T>
impl<T, RhsInt> PartialOrd<Nanoseconds<RhsInt>> for Seconds<T>
Source§impl<T, RhsInt> PartialOrd<Seconds<RhsInt>> for Microseconds<T>
impl<T, RhsInt> PartialOrd<Seconds<RhsInt>> for Microseconds<T>
Source§impl<T, RhsInt> PartialOrd<Seconds<RhsInt>> for Milliseconds<T>
impl<T, RhsInt> PartialOrd<Seconds<RhsInt>> for Milliseconds<T>
Source§impl<T, RhsInt> PartialOrd<Seconds<RhsInt>> for Nanoseconds<T>
impl<T, RhsInt> PartialOrd<Seconds<RhsInt>> for Nanoseconds<T>
Source§impl<T, RhsInt> PartialOrd<Seconds<RhsInt>> for Seconds<T>
impl<T, RhsInt> PartialOrd<Seconds<RhsInt>> for Seconds<T>
Source§impl TryFrom<Microseconds<u64>> for Seconds
impl TryFrom<Microseconds<u64>> for Seconds
Source§impl TryFrom<Milliseconds<u64>> for Seconds
impl TryFrom<Milliseconds<u64>> for Seconds
Source§impl TryFrom<Nanoseconds<u64>> for Seconds
impl TryFrom<Nanoseconds<u64>> for Seconds
Source§impl<T> TryFrom<Seconds<T>> for Microseconds<T>where
T: TimeInt,
impl<T> TryFrom<Seconds<T>> for Microseconds<T>where
T: TimeInt,
Source§fn try_from(
big: Seconds<T>,
) -> Result<Microseconds<T>, <Microseconds<T> as TryFrom<Seconds<T>>>::Error>
fn try_from( big: Seconds<T>, ) -> Result<Microseconds<T>, <Microseconds<T> as TryFrom<Seconds<T>>>::Error>
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§impl<T> TryFrom<Seconds<T>> for Milliseconds<T>where
T: TimeInt,
impl<T> TryFrom<Seconds<T>> for Milliseconds<T>where
T: TimeInt,
Source§fn try_from(
big: Seconds<T>,
) -> Result<Milliseconds<T>, <Milliseconds<T> as TryFrom<Seconds<T>>>::Error>
fn try_from( big: Seconds<T>, ) -> Result<Milliseconds<T>, <Milliseconds<T> as TryFrom<Seconds<T>>>::Error>
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§impl<T> TryFrom<Seconds<T>> for Nanoseconds<T>where
T: TimeInt,
impl<T> TryFrom<Seconds<T>> for Nanoseconds<T>where
T: TimeInt,
Source§fn try_from(
big: Seconds<T>,
) -> Result<Nanoseconds<T>, <Nanoseconds<T> as TryFrom<Seconds<T>>>::Error>
fn try_from( big: Seconds<T>, ) -> Result<Nanoseconds<T>, <Nanoseconds<T> as TryFrom<Seconds<T>>>::Error>
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§impl TryFrom<Seconds<u64>> for Microseconds
impl TryFrom<Seconds<u64>> for Microseconds
Source§impl TryFrom<Seconds<u64>> for Milliseconds
impl TryFrom<Seconds<u64>> for Milliseconds
Source§impl TryFrom<Seconds<u64>> for Nanoseconds
impl TryFrom<Seconds<u64>> for Nanoseconds
impl<T> Copy for Seconds<T>
impl<T> Eq for Seconds<T>
Auto Trait Implementations§
impl<T> Freeze for Seconds<T>where
T: Freeze,
impl<T> RefUnwindSafe for Seconds<T>where
T: RefUnwindSafe,
impl<T> Send for Seconds<T>where
T: Send,
impl<T> Sync for Seconds<T>where
T: Sync,
impl<T> Unpin for Seconds<T>where
T: Unpin,
impl<T> UnwindSafe for Seconds<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