Trait torrust_tracker::shared::clock::time_extent::Extent
source · pub trait Extent: Sized + Default {
type Base;
type Multiplier;
type Product;
// Required methods
fn new(unit: &Self::Base, count: &Self::Multiplier) -> Self;
fn increase(&self, add: Self::Multiplier) -> Result<Self, IntErrorKind>;
fn decrease(&self, sub: Self::Multiplier) -> Result<Self, IntErrorKind>;
fn total(&self) -> Option<Result<Self::Product, TryFromIntError>>;
fn total_next(&self) -> Option<Result<Self::Product, TryFromIntError>>;
}Required Associated Types§
Required Methods§
fn new(unit: &Self::Base, count: &Self::Multiplier) -> Self
sourcefn increase(&self, add: Self::Multiplier) -> Result<Self, IntErrorKind>
fn increase(&self, add: Self::Multiplier) -> Result<Self, IntErrorKind>
Errors
Will return IntErrorKind if add would overflow the internal Duration.
sourcefn decrease(&self, sub: Self::Multiplier) -> Result<Self, IntErrorKind>
fn decrease(&self, sub: Self::Multiplier) -> Result<Self, IntErrorKind>
Errors
Will return IntErrorKind if sub would underflow the internal Duration.