Struct reaper_medium::DurationInSeconds
source · [−]pub struct DurationInSeconds(_);
Expand description
This represents a duration expressed as positive amount of seconds.
Implementations
sourceimpl DurationInSeconds
impl DurationInSeconds
sourcepub const ZERO: DurationInSeconds = _
pub const ZERO: DurationInSeconds = _
The minimum duration (zero, empty).
sourcepub const MIN: DurationInSeconds = Self::ZERO
pub const MIN: DurationInSeconds = Self::ZERO
The minimum duration (zero, empty).
sourcepub const MAX: DurationInSeconds = _
pub const MAX: DurationInSeconds = _
The maximum possible duration (highest possible floating-point number).
sourcepub fn new(value: f64) -> DurationInSeconds
pub fn new(value: f64) -> DurationInSeconds
sourcepub unsafe fn new_unchecked(value: f64) -> DurationInSeconds
pub unsafe fn new_unchecked(value: f64) -> DurationInSeconds
Creates a DurationInSeconds value without bound checking.
Safety
You must ensure that the given value is positive.
Trait Implementations
sourceimpl Add<DurationInSeconds> for DurationInSeconds
impl Add<DurationInSeconds> for DurationInSeconds
type Output = DurationInSeconds
type Output = DurationInSeconds
The resulting type after applying the
+
operator.sourcefn add(self, rhs: DurationInSeconds) -> Self::Output
fn add(self, rhs: DurationInSeconds) -> Self::Output
Performs the
+
operation. Read moresourceimpl Add<DurationInSeconds> for PositionInSeconds
impl Add<DurationInSeconds> for PositionInSeconds
type Output = PositionInSeconds
type Output = PositionInSeconds
The resulting type after applying the
+
operator.sourcefn add(self, rhs: DurationInSeconds) -> Self
fn add(self, rhs: DurationInSeconds) -> Self
Performs the
+
operation. Read moresourceimpl Clone for DurationInSeconds
impl Clone for DurationInSeconds
sourcefn clone(&self) -> DurationInSeconds
fn clone(&self) -> DurationInSeconds
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for DurationInSeconds
impl Debug for DurationInSeconds
sourceimpl Default for DurationInSeconds
impl Default for DurationInSeconds
sourcefn default() -> DurationInSeconds
fn default() -> DurationInSeconds
Returns the “default value” for a type. Read more
sourceimpl Display for DurationInSeconds
impl Display for DurationInSeconds
sourceimpl Div<DurationInSeconds> for PositionInSeconds
impl Div<DurationInSeconds> for PositionInSeconds
type Output = PositionInSeconds
type Output = PositionInSeconds
The resulting type after applying the
/
operator.sourcefn div(self, rhs: DurationInSeconds) -> Self::Output
fn div(self, rhs: DurationInSeconds) -> Self::Output
Performs the
/
operation. Read moresourceimpl From<DurationInSeconds> for PositionInSeconds
impl From<DurationInSeconds> for PositionInSeconds
sourcefn from(v: DurationInSeconds) -> Self
fn from(v: DurationInSeconds) -> Self
Converts to this type from the input type.
sourceimpl Mul<f64> for DurationInSeconds
impl Mul<f64> for DurationInSeconds
sourceimpl Ord for DurationInSeconds
impl Ord for DurationInSeconds
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<DurationInSeconds> for DurationInSeconds
impl PartialEq<DurationInSeconds> for DurationInSeconds
sourcefn eq(&self, other: &DurationInSeconds) -> bool
fn eq(&self, other: &DurationInSeconds) -> bool
sourceimpl PartialEq<DurationInSeconds> for PositionInSeconds
impl PartialEq<DurationInSeconds> for PositionInSeconds
sourcefn eq(&self, other: &DurationInSeconds) -> bool
fn eq(&self, other: &DurationInSeconds) -> bool
sourceimpl PartialOrd<DurationInSeconds> for DurationInSeconds
impl PartialOrd<DurationInSeconds> for DurationInSeconds
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const 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 PartialOrd<DurationInSeconds> for PositionInSeconds
impl PartialOrd<DurationInSeconds> for PositionInSeconds
sourcefn partial_cmp(&self, other: &DurationInSeconds) -> Option<Ordering>
fn partial_cmp(&self, other: &DurationInSeconds) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const 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 Rem<DurationInSeconds> for PositionInSeconds
impl Rem<DurationInSeconds> for PositionInSeconds
type Output = Option<PositionInSeconds>
type Output = Option<PositionInSeconds>
The resulting type after applying the
%
operator.sourcefn rem(self, rhs: DurationInSeconds) -> Option<Self>
fn rem(self, rhs: DurationInSeconds) -> Option<Self>
Performs the
%
operation. Read moresourceimpl Sub<DurationInSeconds> for PositionInSeconds
impl Sub<DurationInSeconds> for PositionInSeconds
type Output = PositionInSeconds
type Output = PositionInSeconds
The resulting type after applying the
-
operator.sourcefn sub(self, rhs: DurationInSeconds) -> Self
fn sub(self, rhs: DurationInSeconds) -> Self
Performs the
-
operation. Read moresourceimpl TryFrom<PositionInSeconds> for DurationInSeconds
impl TryFrom<PositionInSeconds> for DurationInSeconds
type Error = TryFromGreaterError<f64>
type Error = TryFromGreaterError<f64>
The type returned in the event of a conversion error.
sourcefn try_from(value: PositionInSeconds) -> Result<Self, Self::Error>
fn try_from(value: PositionInSeconds) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<f64> for DurationInSeconds
impl TryFrom<f64> for DurationInSeconds
impl Copy for DurationInSeconds
impl Eq for DurationInSeconds
impl StructuralPartialEq for DurationInSeconds
Auto Trait Implementations
impl RefUnwindSafe for DurationInSeconds
impl Send for DurationInSeconds
impl Sync for DurationInSeconds
impl Unpin for DurationInSeconds
impl UnwindSafe for DurationInSeconds
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
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read moresourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more