Struct embedded_time::duration::Generic [−][src]
pub struct Generic<T> { /* fields omitted */ }
Expand description
The Generic
Duration
type allows an arbitrary scaling factor to be used without having to
impl FixedPoint
.
The purpose of this type is to allow a simple Duration
object that can be defined at run-time.
It does this by replacing the const
scaling factor with a struct field.
Implementations
Trait Implementations
fn to_generic<DestInt: TimeInt>(
self,
scaling_factor: Fraction
) -> Result<Generic<DestInt>, ConversionError> where
Self: FixedPoint,
DestInt: TryFrom<Self::T>,
fn to_generic<DestInt: TimeInt>(
self,
scaling_factor: Fraction
) -> Result<Generic<DestInt>, ConversionError> where
Self: FixedPoint,
DestInt: TryFrom<Self::T>,
Construct a Generic
Duration
from a named Duration
(eg.
Milliseconds
) Read more
fn to_rate<Rate: Rate>(&self) -> Result<Rate, ConversionError> where
Rate: FixedPoint,
Self: FixedPoint,
Rate::T: TryFrom<Self::T>,
fn to_rate<Rate: Rate>(&self) -> Result<Rate, ConversionError> where
Rate: FixedPoint,
Self: FixedPoint,
Rate::T: TryFrom<Self::T>,
See Comparisons
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.