Struct chronologic::TimeValue 
source · [−]pub struct TimeValue(_);Expand description
A single time value (duration)
This time value represent a duration and could be infinite.
Implementations
sourceimpl TimeValue
 
impl TimeValue
pub fn from_ticks(t: i64) -> Self
pub unsafe fn from_ticks_unchecked(t: i64) -> Self
pub fn from_secs(sec: i64) -> Self
pub fn from_days(days: i64) -> Self
pub fn from_hours(hours: i64) -> Self
pub fn from_minutes(minutes: i64) -> Self
pub fn from_millis(millis: i64) -> Self
pub fn from_micros(micros: i64) -> Self
pub fn from_nanos(nanos: i64) -> Self
pub fn as_ticks(&self) -> i64
pub fn as_secs(&self) -> i64
pub fn subsec_millis(&self) -> i32
pub fn subsec_micros(&self) -> i32
pub fn subsec_nanos(&self) -> i32
pub fn to_duration(&self) -> Duration
pub fn is_zero(&self) -> bool
pub fn is_positive(&self) -> bool
pub fn is_negative(&self) -> bool
pub fn is_strictly_positive(&self) -> bool
pub fn is_strictly_negative(&self) -> bool
pub fn floor(self, period: TimeValue) -> Self
pub fn ceil(self, period: TimeValue) -> Self
Trait Implementations
sourceimpl<T> Add<TimeInterval<T>> for TimeValue where
    T: TimePoint + Add<TimeValue, Output = T>, 
 
impl<T> Add<TimeInterval<T>> for TimeValue where
    T: TimePoint + Add<TimeValue, Output = T>, 
type Output = TimeInterval<T>
type Output = TimeInterval<T>
The resulting type after applying the + operator.
sourcefn add(self, other: TimeInterval<T>) -> Self::Output
 
fn add(self, other: TimeInterval<T>) -> Self::Output
Performs the + operation. Read more
sourceimpl<T> AddAssign<TimeValue> for TimeInterval<T> where
    T: TimePoint + AddAssign<TimeValue>, 
 
impl<T> AddAssign<TimeValue> for TimeInterval<T> where
    T: TimePoint + AddAssign<TimeValue>, 
sourcefn add_assign(&mut self, other: TimeValue)
 
fn add_assign(&mut self, other: TimeValue)
Performs the += operation. Read more
sourceimpl<T: TimePoint> AddAssign<TimeValue> for TimeSet<T> where
    TimeInterval<T>: AddAssign<TimeValue>, 
 
impl<T: TimePoint> AddAssign<TimeValue> for TimeSet<T> where
    TimeInterval<T>: AddAssign<TimeValue>, 
sourcefn add_assign(&mut self, t: TimeValue)
 
fn add_assign(&mut self, t: TimeValue)
Performs the += operation. Read more
sourceimpl AddAssign<TimeValue> for TimeValue
 
impl AddAssign<TimeValue> for TimeValue
sourcefn add_assign(&mut self, other: TimeValue)
 
fn add_assign(&mut self, other: TimeValue)
Performs the += operation. Read more
sourceimpl AddAssign<TimeValue> for Timestamp
 
impl AddAssign<TimeValue> for Timestamp
sourcefn add_assign(&mut self, other: TimeValue)
 
fn add_assign(&mut self, other: TimeValue)
Performs the += operation. Read more
sourceimpl DivAssign<f64> for TimeValue
 
impl DivAssign<f64> for TimeValue
sourcefn div_assign(&mut self, n: f64)
 
fn div_assign(&mut self, n: f64)
Performs the /= operation. Read more
sourceimpl DivAssign<i64> for TimeValue
 
impl DivAssign<i64> for TimeValue
sourcefn div_assign(&mut self, n: i64)
 
fn div_assign(&mut self, n: i64)
Performs the /= operation. Read more
sourceimpl DivAssign<usize> for TimeValue
 
impl DivAssign<usize> for TimeValue
sourcefn div_assign(&mut self, n: usize)
 
fn div_assign(&mut self, n: usize)
Performs the /= operation. Read more
sourceimpl MulAssign<f64> for TimeValue
 
impl MulAssign<f64> for TimeValue
sourcefn mul_assign(&mut self, n: f64)
 
fn mul_assign(&mut self, n: f64)
Performs the *= operation. Read more
sourceimpl MulAssign<i64> for TimeValue
 
impl MulAssign<i64> for TimeValue
sourcefn mul_assign(&mut self, n: i64)
 
fn mul_assign(&mut self, n: i64)
Performs the *= operation. Read more
sourceimpl MulAssign<usize> for TimeValue
 
impl MulAssign<usize> for TimeValue
sourcefn mul_assign(&mut self, n: usize)
 
fn mul_assign(&mut self, n: usize)
Performs the *= operation. Read more
sourceimpl Ord for TimeValue
 
impl Ord for TimeValue
1.21.0 · sourcefn max(self, other: Self) -> Self
 
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
 
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
    Self: PartialOrd<Self>, 
 
fn clamp(self, min: Self, max: Self) -> Self where
    Self: PartialOrd<Self>, 
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<TimeValue> for TimeValue
 
impl PartialEq<TimeValue> for TimeValue
sourceimpl PartialOrd<TimeValue> for TimeValue
 
impl PartialOrd<TimeValue> for TimeValue
sourcefn partial_cmp(&self, other: &TimeValue) -> Option<Ordering>
 
fn partial_cmp(&self, other: &TimeValue) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
 
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
 
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 more
sourceimpl<T> Sub<TimeInterval<T>> for TimeValue where
    T: TimePoint + Add<TimeValue, Output = T>, 
 
impl<T> Sub<TimeInterval<T>> for TimeValue where
    T: TimePoint + Add<TimeValue, Output = T>, 
type Output = TimeInterval<T>
type Output = TimeInterval<T>
The resulting type after applying the - operator.
sourcefn sub(self, other: TimeInterval<T>) -> Self::Output
 
fn sub(self, other: TimeInterval<T>) -> Self::Output
Performs the - operation. Read more
sourceimpl<T> SubAssign<TimeValue> for TimeInterval<T> where
    T: TimePoint + SubAssign<TimeValue>, 
 
impl<T> SubAssign<TimeValue> for TimeInterval<T> where
    T: TimePoint + SubAssign<TimeValue>, 
sourcefn sub_assign(&mut self, other: TimeValue)
 
fn sub_assign(&mut self, other: TimeValue)
Performs the -= operation. Read more
sourceimpl<T: TimePoint> SubAssign<TimeValue> for TimeSet<T> where
    TimeInterval<T>: SubAssign<TimeValue>, 
 
impl<T: TimePoint> SubAssign<TimeValue> for TimeSet<T> where
    TimeInterval<T>: SubAssign<TimeValue>, 
sourcefn sub_assign(&mut self, t: TimeValue)
 
fn sub_assign(&mut self, t: TimeValue)
Performs the -= operation. Read more
sourceimpl SubAssign<TimeValue> for TimeValue
 
impl SubAssign<TimeValue> for TimeValue
sourcefn sub_assign(&mut self, v: TimeValue)
 
fn sub_assign(&mut self, v: TimeValue)
Performs the -= operation. Read more
sourceimpl SubAssign<TimeValue> for Timestamp
 
impl SubAssign<TimeValue> for Timestamp
sourcefn sub_assign(&mut self, other: TimeValue)
 
fn sub_assign(&mut self, other: TimeValue)
Performs the -= operation. Read more
sourceimpl TimePoint for TimeValue
 
impl TimePoint for TimeValue
sourcefn is_future_infinite(&self) -> bool
 
fn is_future_infinite(&self) -> bool
Checks if this value is +∞
sourcefn is_past_infinite(&self) -> bool
 
fn is_past_infinite(&self) -> bool
Checks if this value is -∞
sourcefn just_after(&self) -> TimeValue
 
fn just_after(&self) -> TimeValue
Returns a value just after
sourcefn just_before(&self) -> TimeValue
 
fn just_before(&self) -> TimeValue
Returns a value just before
impl Copy for TimeValue
impl Eq for TimeValue
impl StructuralEq for TimeValue
impl StructuralPartialEq for TimeValue
Auto Trait Implementations
impl RefUnwindSafe for TimeValue
impl Send for TimeValue
impl Sync for TimeValue
impl Unpin for TimeValue
impl UnwindSafe for TimeValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
    T: ?Sized, 
 
impl<T> BorrowMut<T> for T where
    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