pub struct TimeExtent {
pub increment: Base,
pub amount: Multiplier,
}Expand description
A TimeExtent is a duration of time which contains N times intervals
of the same duration.
Fields§
§increment: Base§amount: MultiplierImplementations§
source§impl TimeExtent
impl TimeExtent
pub const fn from_sec(seconds: u64, amount: &Multiplier) -> Self
Trait Implementations§
source§impl Debug for TimeExtent
impl Debug for TimeExtent
source§impl Default for TimeExtent
impl Default for TimeExtent
source§fn default() -> TimeExtent
fn default() -> TimeExtent
Returns the “default value” for a type. Read more
source§impl Extent for TimeExtent
impl Extent for TimeExtent
type Base = Duration
type Multiplier = u64
type Product = Duration
source§fn new(increment: &Self::Base, amount: &Self::Multiplier) -> Self
fn new(increment: &Self::Base, amount: &Self::Multiplier) -> Self
It creates a new
TimeExtent.source§fn increase(&self, add: Self::Multiplier) -> Result<Self, IntErrorKind>
fn increase(&self, add: Self::Multiplier) -> Result<Self, IntErrorKind>
It increases the
TimeExtent by a multiplier. Read moresource§fn decrease(&self, sub: Self::Multiplier) -> Result<Self, IntErrorKind>
fn decrease(&self, sub: Self::Multiplier) -> Result<Self, IntErrorKind>
It decreases the
TimeExtent by a multiplier. Read moresource§fn total(&self) -> Option<Result<Self::Product, TryFromIntError>>
fn total(&self) -> Option<Result<Self::Product, TryFromIntError>>
It returns the total
Duration of the TimeExtent.source§fn total_next(&self) -> Option<Result<Self::Product, TryFromIntError>>
fn total_next(&self) -> Option<Result<Self::Product, TryFromIntError>>
It returns the total
Duration of the TimeExtent plus one increment.source§impl Hash for TimeExtent
impl Hash for TimeExtent
source§impl PartialEq for TimeExtent
impl PartialEq for TimeExtent
impl Eq for TimeExtent
impl StructuralPartialEq for TimeExtent
Auto Trait Implementations§
impl Freeze for TimeExtent
impl RefUnwindSafe for TimeExtent
impl Send for TimeExtent
impl Sync for TimeExtent
impl Unpin for TimeExtent
impl UnwindSafe for TimeExtent
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more