Struct TimeValue

Source
pub struct TimeValue(/* private fields */);
Expand description

§A single time value (duration)

This time value represent a duration and could be infinite.

Implementations§

Source§

impl TimeValue

Source

pub fn from_ticks(t: i64) -> Self

Creates a new time value for a number of clock ticks.

A clock tick is the smallest duration of time taken into account by this crate. It is about a nanosecond.

A tick is exactly defined as 1/2^30 seconds

If the given number of ticks is less than -TimeValue::INFINITE or greater than TimeValue::INFINITE, the time value is set to infinite.

If you are sure that the number of ticks is within the finite range value, using the unsafe version Self::from_ticks_unchecked could be considered

Source

pub unsafe fn from_ticks_unchecked(t: i64) -> Self

Creates a new time value for a number of clock ticks.

A clock tick is the smallest duration of time taken into account by this crate.

§Safety

If the given number of ticks is less than -TimeValue::INFINITE or greater than TimeValue::INFINITE, the behaviour of the time value is unpredictable.

For a safety use, consider Self::from_ticks.

Source

pub fn from_secs(sec: i64) -> Self

Duration from a number of seconds

Source

pub fn from_years(years: i64) -> Self

Duration from a number of years

Important note: a year is defined as an average duration of a little less than 365.25 in order to take into account leap years. More precisely, a year is defined as 146097/400 days.

Source

pub fn from_months(months: i64) -> Self

Duration from a number of months

Important note: a month is defined as one twelfth of a year. It is therefore defined as a duration of just under 30.5 days.

Source

pub fn from_weeks(weeks: i64) -> Self

Duration from a number of weeks

A week is defined as a duration of 7 days.

Source

pub fn from_days(days: i64) -> Self

Duration from a number of days

A day is defined as a duration of 24 hours.

Source

pub fn from_hours(hours: i64) -> Self

Duration from a number of hours

A hour is defined as a duration of 60 minutes (or 3600s).

Source

pub fn from_mins(mins: i64) -> Self

Duration from a number of minutes

A minute is defined as a duration of 60 seconds.

Source

pub fn from_millis(millis: i64) -> Self

Approximate duration from a number of milliseconds

Important note: the fractional part of a second is represented in ticks which is an internal representation close to (but not equal) the nanosecond.

Source

pub fn from_micros(micros: i64) -> Self

Approximate duration from a number of microseconds

Important note: the fractional part of a second is represented in ticks which is an internal representation close to (but not equal) the nanosecond.

Source

pub fn from_nanos(nanos: i64) -> Self

Approximate duration from a number of nanoseconds

Important note: the fractional part of a second is represented in ticks which is an internal representation close to (but not equal) the nanosecond.

Source

pub fn as_ticks(&self) -> i64

Source

pub fn as_secs(&self) -> i64

Source

pub fn subsec_millis(&self) -> i32

Fractional part of a time value (milliseconds)

Important note: the fractional part of a second is represented in ticks which is an internal representation close to (but not equal) the nanosecond.

Source

pub fn subsec_micros(&self) -> i32

Fractional part of a time value (microseconds)

Important note: the fractional part of a second is represented in ticks which is an internal representation close to (but not equal) the nanosecond.

Source

pub fn subsec_nanos(&self) -> i32

Fractional part of the time value (nanoseconds)

Important note: the fractional part of a second is represented in ticks which is an internal representation close to (but not equal) the nanosecond.

Source

pub fn to_duration(&self) -> Duration

Source

pub fn is_zero(&self) -> bool

Source

pub fn is_positive(&self) -> bool

Source

pub fn is_negative(&self) -> bool

Source

pub fn is_strictly_positive(&self) -> bool

Source

pub fn is_strictly_negative(&self) -> bool

Source

pub fn floor(self, period: TimeValue) -> Self

Source

pub fn ceil(self, period: TimeValue) -> Self

Trait Implementations§

Source§

impl<T> Add<TimeInterval<T>> for TimeValue
where T: TimePoint + Add<TimeValue, Output = T>,

Source§

type Output = TimeInterval<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: TimeInterval<T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T> Add<TimeValue> for TimeInterval<T>
where T: TimePoint + Add<TimeValue, Output = T>,

Source§

type Output = TimeInterval<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: TimeValue) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: TimePoint> Add<TimeValue> for TimeSet<T>
where TimeInterval<T>: Add<TimeValue, Output = TimeInterval<T>>,

Source§

type Output = TimeSet<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: TimeValue) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<TimeValue> for Timestamp

Source§

type Output = Timestamp

The resulting type after applying the + operator.
Source§

fn add(self, other: TimeValue) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<Timestamp> for TimeValue

Source§

type Output = Timestamp

The resulting type after applying the + operator.
Source§

fn add(self, tw: Self::Output) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
Source§

impl<T> AddAssign<TimeValue> for TimeInterval<T>

Source§

fn add_assign(&mut self, other: TimeValue)

Performs the += operation. Read more
Source§

impl<T: TimePoint> AddAssign<TimeValue> for TimeSet<T>

Source§

fn add_assign(&mut self, t: TimeValue)

Performs the += operation. Read more
Source§

impl AddAssign<TimeValue> for Timestamp

Source§

fn add_assign(&mut self, other: TimeValue)

Performs the += operation. Read more
Source§

impl AddAssign for TimeValue

Source§

fn add_assign(&mut self, other: TimeValue)

Performs the += operation. Read more
Source§

impl<TW> BitAnd<TW> for TimeValue
where TW: TimeConvex<TimePoint = TimeValue>,

Source§

type Output = TimeInterval<TimeValue>

The resulting type after applying the & operator.
Source§

fn bitand(self, tw: TW) -> Self::Output

Performs the & operation. Read more
Source§

impl<TW> BitOr<TW> for TimeValue
where TW: TimeConvex<TimePoint = TimeValue>,

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the | operator.
Source§

fn bitor(self, tw: TW) -> Self::Output

Performs the | operation. Read more
Source§

impl Clone for TimeValue

Source§

fn clone(&self) -> TimeValue

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TimeValue

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TimeValue

Source§

fn default() -> TimeValue

Returns the “default value” for a type. Read more
Source§

impl Display for TimeValue

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Div<f32> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the / operator.
Source§

fn div(self, n: f32) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f64> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the / operator.
Source§

fn div(self, n: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<i128> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the / operator.
Source§

fn div(self, n: i128) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<i16> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the / operator.
Source§

fn div(self, n: i16) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<i32> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the / operator.
Source§

fn div(self, n: i32) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<i64> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the / operator.
Source§

fn div(self, n: i64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<i8> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the / operator.
Source§

fn div(self, n: i8) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<isize> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the / operator.
Source§

fn div(self, n: isize) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<u128> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the / operator.
Source§

fn div(self, n: u128) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<u16> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the / operator.
Source§

fn div(self, n: u16) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<u32> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the / operator.
Source§

fn div(self, n: u32) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<u64> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the / operator.
Source§

fn div(self, n: u64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<u8> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the / operator.
Source§

fn div(self, n: u8) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<usize> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the / operator.
Source§

fn div(self, n: usize) -> Self::Output

Performs the / operation. Read more
Source§

impl DivAssign<f32> for TimeValue

Source§

fn div_assign(&mut self, n: f32)

Performs the /= operation. Read more
Source§

impl DivAssign<f64> for TimeValue

Source§

fn div_assign(&mut self, n: f64)

Performs the /= operation. Read more
Source§

impl DivAssign<i128> for TimeValue

Source§

fn div_assign(&mut self, n: i128)

Performs the /= operation. Read more
Source§

impl DivAssign<i16> for TimeValue

Source§

fn div_assign(&mut self, n: i16)

Performs the /= operation. Read more
Source§

impl DivAssign<i32> for TimeValue

Source§

fn div_assign(&mut self, n: i32)

Performs the /= operation. Read more
Source§

impl DivAssign<i64> for TimeValue

Source§

fn div_assign(&mut self, n: i64)

Performs the /= operation. Read more
Source§

impl DivAssign<i8> for TimeValue

Source§

fn div_assign(&mut self, n: i8)

Performs the /= operation. Read more
Source§

impl DivAssign<isize> for TimeValue

Source§

fn div_assign(&mut self, n: isize)

Performs the /= operation. Read more
Source§

impl DivAssign<u128> for TimeValue

Source§

fn div_assign(&mut self, n: u128)

Performs the /= operation. Read more
Source§

impl DivAssign<u16> for TimeValue

Source§

fn div_assign(&mut self, n: u16)

Performs the /= operation. Read more
Source§

impl DivAssign<u32> for TimeValue

Source§

fn div_assign(&mut self, n: u32)

Performs the /= operation. Read more
Source§

impl DivAssign<u64> for TimeValue

Source§

fn div_assign(&mut self, n: u64)

Performs the /= operation. Read more
Source§

impl DivAssign<u8> for TimeValue

Source§

fn div_assign(&mut self, n: u8)

Performs the /= operation. Read more
Source§

impl DivAssign<usize> for TimeValue

Source§

fn div_assign(&mut self, n: usize)

Performs the /= operation. Read more
Source§

impl From<Duration> for TimeValue

Source§

fn from(t: Duration) -> Self

Converts to this type from the input type.
Source§

impl From<TimeDelta> for TimeValue

Source§

fn from(t: Duration) -> Self

Converts to this type from the input type.
Source§

impl From<TimeValue> for Duration

Source§

fn from(value: TimeValue) -> Self

Converts to this type from the input type.
Source§

impl From<TimeValue> for Duration

Source§

fn from(value: TimeValue) -> Self

Converts to this type from the input type.
Source§

impl Hash for TimeValue

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl IntoTimeValue for TimeValue

Source§

impl Mul<TimeValue> for f32

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeValue) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeValue> for f64

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeValue) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeValue> for i128

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeValue) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeValue> for i16

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeValue) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeValue> for i32

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeValue) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeValue> for i64

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeValue) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeValue> for i8

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeValue) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeValue> for isize

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeValue) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeValue> for u128

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeValue) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeValue> for u16

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeValue) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeValue> for u32

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeValue) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeValue> for u64

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeValue) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeValue> for u8

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeValue) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<TimeValue> for usize

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, t: TimeValue) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f32> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, n: f32) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f64> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, n: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i128> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, n: i128) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i16> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, n: i16) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i32> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, n: i32) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i64> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, n: i64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i8> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, n: i8) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<isize> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, n: isize) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<u128> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, n: u128) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<u16> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, n: u16) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<u32> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, n: u32) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<u64> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, n: u64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<u8> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, n: u8) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<usize> for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the * operator.
Source§

fn mul(self, n: usize) -> Self::Output

Performs the * operation. Read more
Source§

impl MulAssign<f32> for TimeValue

Source§

fn mul_assign(&mut self, n: f32)

Performs the *= operation. Read more
Source§

impl MulAssign<f64> for TimeValue

Source§

fn mul_assign(&mut self, n: f64)

Performs the *= operation. Read more
Source§

impl MulAssign<i128> for TimeValue

Source§

fn mul_assign(&mut self, n: i128)

Performs the *= operation. Read more
Source§

impl MulAssign<i16> for TimeValue

Source§

fn mul_assign(&mut self, n: i16)

Performs the *= operation. Read more
Source§

impl MulAssign<i32> for TimeValue

Source§

fn mul_assign(&mut self, n: i32)

Performs the *= operation. Read more
Source§

impl MulAssign<i64> for TimeValue

Source§

fn mul_assign(&mut self, n: i64)

Performs the *= operation. Read more
Source§

impl MulAssign<i8> for TimeValue

Source§

fn mul_assign(&mut self, n: i8)

Performs the *= operation. Read more
Source§

impl MulAssign<isize> for TimeValue

Source§

fn mul_assign(&mut self, n: isize)

Performs the *= operation. Read more
Source§

impl MulAssign<u128> for TimeValue

Source§

fn mul_assign(&mut self, n: u128)

Performs the *= operation. Read more
Source§

impl MulAssign<u16> for TimeValue

Source§

fn mul_assign(&mut self, n: u16)

Performs the *= operation. Read more
Source§

impl MulAssign<u32> for TimeValue

Source§

fn mul_assign(&mut self, n: u32)

Performs the *= operation. Read more
Source§

impl MulAssign<u64> for TimeValue

Source§

fn mul_assign(&mut self, n: u64)

Performs the *= operation. Read more
Source§

impl MulAssign<u8> for TimeValue

Source§

fn mul_assign(&mut self, n: u8)

Performs the *= operation. Read more
Source§

impl MulAssign<usize> for TimeValue

Source§

fn mul_assign(&mut self, n: usize)

Performs the *= operation. Read more
Source§

impl Neg for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Not for TimeValue

Source§

type Output = TimeSet<TimeValue>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl Ord for TimeValue

Source§

fn cmp(&self, other: &TimeValue) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for TimeValue

Source§

fn eq(&self, other: &TimeValue) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for TimeValue

Source§

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 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T> Sub<TimeInterval<T>> for TimeValue
where T: TimePoint + Add<TimeValue, Output = T>,

Source§

type Output = TimeInterval<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: TimeInterval<T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T> Sub<TimeValue> for TimeInterval<T>
where T: TimePoint + Sub<TimeValue, Output = T>,

Source§

type Output = TimeInterval<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: TimeValue) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: TimePoint> Sub<TimeValue> for TimeSet<T>
where TimeInterval<T>: Sub<TimeValue, Output = TimeInterval<T>>,

Source§

type Output = TimeSet<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: TimeValue) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<TimeValue> for Timestamp

Source§

type Output = Timestamp

The resulting type after applying the - operator.
Source§

fn sub(self, other: TimeValue) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<Timestamp> for TimeValue

Source§

type Output = Timestamp

The resulting type after applying the - operator.
Source§

fn sub(self, tw: Self::Output) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for TimeValue

Source§

type Output = TimeValue

The resulting type after applying the - operator.
Source§

fn sub(self, v: TimeValue) -> Self

Performs the - operation. Read more
Source§

impl<T> SubAssign<TimeValue> for TimeInterval<T>

Source§

fn sub_assign(&mut self, other: TimeValue)

Performs the -= operation. Read more
Source§

impl<T: TimePoint> SubAssign<TimeValue> for TimeSet<T>

Source§

fn sub_assign(&mut self, t: TimeValue)

Performs the -= operation. Read more
Source§

impl SubAssign<TimeValue> for Timestamp

Source§

fn sub_assign(&mut self, other: TimeValue)

Performs the -= operation. Read more
Source§

impl SubAssign for TimeValue

Source§

fn sub_assign(&mut self, v: TimeValue)

Performs the -= operation. Read more
Source§

impl Sum for TimeValue

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl TimeBounds for TimeValue

Source§

type TimePoint = TimeValue

The type of the underlying time data. Read more
Source§

fn is_empty(&self) -> bool

Checks if this time window is empty
Source§

fn is_singleton(&self) -> bool

Checks if this time window contains exactly one value Read more
Source§

fn is_bounded(&self) -> bool

Checks if this time window is bounded Read more
Source§

fn is_low_bounded(&self) -> bool

Checks if this time window has a finite lower bound Read more
Source§

fn is_up_bounded(&self) -> bool

Checks if this time window has a finite upper bound Read more
Source§

fn lower_bound(&self) -> Self::TimePoint

The lower bound of the time window Read more
Source§

fn upper_bound(&self) -> Self::TimePoint

The upper bound of the time window Read more
Source§

impl TimePoint for TimeValue

Source§

const INFINITE: TimeValue

The infinite time point (∞) which is used to infinite time window bounds
Source§

fn is_future_infinite(&self) -> bool

Checks if this value equals +∞
Source§

fn is_past_infinite(&self) -> bool

Checks if this value equals -∞
Source§

fn is_finite(&self) -> bool

Checks if this value is finite
Source§

fn just_after(&self) -> TimeValue

Returns a value just after this one Read more
Source§

fn just_before(&self) -> TimeValue

Returns a value just before this one Read more
Source§

impl TimePointFormat for TimeValue

Source§

fn format_timepoint(self, _timefmt: &str) -> String

Source§

impl<I: TimeConvexIterator> TimeTranslation<TimeValue> for I
where I::Item: Add<TimeValue, Output = I::Item>,

Source§

type Output = TimeValueTranslIter<I>

Source§

fn translation(self, t: TimeValue) -> Self::Output

Source§

impl Copy for TimeValue

Source§

impl Eq for TimeValue

Source§

impl StructuralPartialEq for TimeValue

Source§

impl TimeConvex for TimeValue

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<TW1, TW2> TimeContaining<TW2> for TW1
where TW1: TimeConvex, TW2: TimeBounds<TimePoint = <TW1 as TimeBounds>::TimePoint>,

Source§

fn contains(&self, rhs: &TW2) -> bool

Source§

impl<TW1, TW2> TimeOverlapping<TW2> for TW1
where TW1: TimeConvex, TW2: TimeConvex<TimePoint = <TW1 as TimeBounds>::TimePoint> + TimeBounds,

Source§

fn overlaps(&self, rhs: &TW2) -> bool

Source§

impl<TW> TimeOverlapping<TimeSet<<TW as TimeBounds>::TimePoint>> for TW
where TW: TimeConvex,

Source§

fn overlaps(&self, rhs: &TimeSet<<TW as TimeBounds>::TimePoint>) -> bool

Source§

impl<TW> TimeSetFormat for TW

Source§

fn format_timeset(&self, timefmt: &str) -> String

Source§

impl<TW> TimeWindow for TW
where TW: TimeConvex,

Source§

fn is_convex(&self) -> bool

Checks if the time window is convex or not

A time window is convex if it is a single time interval (or if it is empty)

Source§

fn convex_count(&self) -> usize

Gets the number of convex parts of the time window

It returns 0 for empty time windows and 1 for non-empty interval.

Source§

type ConvexIter = IntoIter<TimeInterval<<TW as TimeBounds>::TimePoint>>

Source§

fn iter(&self) -> <TW as TimeWindow>::ConvexIter

Source§

fn is_all(&self) -> bool

Source§

fn convex_envelope(&self) -> TimeInterval<Self::TimePoint>

Convex envelope of the time window Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.