Struct nyx_space::time::Duration [−][src]
Defines generally usable durations for high precision math with Epoch (all data is stored in seconds)
Implementations
impl Duration
[src]
pub fn from_days(days: GenericDecimal<u128, u16>) -> Duration
[src]
pub fn from_hours(hours: GenericDecimal<u128, u16>) -> Duration
[src]
pub fn from_minutes(minutes: GenericDecimal<u128, u16>) -> Duration
[src]
pub fn from_seconds(seconds: GenericDecimal<u128, u16>) -> Duration
[src]
pub fn from_milliseconds(ms: GenericDecimal<u128, u16>) -> Duration
[src]
pub fn from_microseconds(us: GenericDecimal<u128, u16>) -> Duration
[src]
pub fn from_nanoseconds(ns: GenericDecimal<u128, u16>) -> Duration
[src]
pub fn from_f64(value: f64, unit: TimeUnit) -> Duration
[src]
Creates a new duration from the provided unit
pub fn from_fraction(num: i64, denom: i64, unit: TimeUnit) -> Duration
[src]
Creates a new duration from the provided fraction and unit
pub fn in_unit_f64(&self, unit: TimeUnit) -> f64
[src]
Returns this duration in f64 in the provided unit. For high fidelity comparisons, it is recommended to keep using the Duration structure.
pub fn in_seconds(&self) -> f64
[src]
Returns this duration in seconds f64. For high fidelity comparisons, it is recommended to keep using the Duration structure.
pub fn in_unit(&self, unit: TimeUnit) -> GenericDecimal<u128, u16>
[src]
Returns the value of this duration in the requested unit.
pub fn abs(&self) -> Duration
[src]
Returns the absolute value of this duration
Trait Implementations
impl Add<Duration> for Epoch
[src]
type Output = Epoch
The resulting type after applying the +
operator.
pub fn add(self, duration: Duration) -> Epoch
[src]
impl Add<Duration> for Duration
[src]
type Output = Duration
The resulting type after applying the +
operator.
pub fn add(self, rhs: Duration) -> Duration
[src]
impl Add<TimeUnit> for Duration
[src]
type Output = Duration
The resulting type after applying the +
operator.
pub fn add(self, rhs: TimeUnit) -> Duration
[src]
impl AddAssign<Duration> for Duration
[src]
pub fn add_assign(&mut self, rhs: Duration)
[src]
impl AddAssign<Duration> for Epoch
[src]
pub fn add_assign(&mut self, duration: Duration)
[src]
impl AddAssign<TimeUnit> for Duration
[src]
pub fn add_assign(&mut self, rhs: TimeUnit)
[src]
impl Clone for Duration
[src]
impl Copy for Duration
[src]
impl Debug for Duration
[src]
impl<'de> Deserialize<'de> for Duration
[src]
pub fn deserialize<D>(
deserializer: D
) -> Result<Duration, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]
deserializer: D
) -> Result<Duration, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl Display for Duration
[src]
impl Div<f32> for Duration
[src]
type Output = Duration
The resulting type after applying the /
operator.
pub fn div(self, q: f32) -> Duration
[src]
impl Div<f64> for Duration
[src]
type Output = Duration
The resulting type after applying the /
operator.
pub fn div(self, q: f64) -> Duration
[src]
impl Div<i16> for Duration
[src]
type Output = Duration
The resulting type after applying the /
operator.
pub fn div(self, q: i16) -> Duration
[src]
impl Div<i32> for Duration
[src]
type Output = Duration
The resulting type after applying the /
operator.
pub fn div(self, q: i32) -> Duration
[src]
impl Div<i64> for Duration
[src]
type Output = Duration
The resulting type after applying the /
operator.
pub fn div(self, q: i64) -> Duration
[src]
impl Div<i8> for Duration
[src]
type Output = Duration
The resulting type after applying the /
operator.
pub fn div(self, q: i8) -> Duration
[src]
impl Div<u128> for Duration
[src]
type Output = Duration
The resulting type after applying the /
operator.
pub fn div(self, q: u128) -> Duration
[src]
impl Div<u16> for Duration
[src]
type Output = Duration
The resulting type after applying the /
operator.
pub fn div(self, q: u16) -> Duration
[src]
impl Div<u32> for Duration
[src]
type Output = Duration
The resulting type after applying the /
operator.
pub fn div(self, q: u32) -> Duration
[src]
impl Div<u64> for Duration
[src]
type Output = Duration
The resulting type after applying the /
operator.
pub fn div(self, q: u64) -> Duration
[src]
impl Div<u8> for Duration
[src]
type Output = Duration
The resulting type after applying the /
operator.
pub fn div(self, q: u8) -> Duration
[src]
impl FromStr for Duration
[src]
type Err = Errors
The associated error which can be returned from parsing.
pub fn from_str(s: &str) -> Result<Duration, <Duration as FromStr>::Err>
[src]
Attempts to convert a simple string to a Duration. Does not yet support complicated durations.
Identifiers: + d, days, day + h, hours, hour + min, mins, minute + s, second, seconds + ms, millisecond, milliseconds + us, microsecond, microseconds + ns, nanosecond, nanoseconds
Example
use hifitime::{Duration, TimeUnit}; use std::str::FromStr; assert_eq!(Duration::from_str("1 d").unwrap(), TimeUnit::Day * 1); assert_eq!(Duration::from_str("10.598 days").unwrap(), TimeUnit::Day * 10.598); assert_eq!(Duration::from_str("10.598 min").unwrap(), TimeUnit::Minute * 10.598); assert_eq!(Duration::from_str("10.598 us").unwrap(), TimeUnit::Microsecond * 10.598); assert_eq!(Duration::from_str("10.598 seconds").unwrap(), TimeUnit::Second * 10.598); assert_eq!(Duration::from_str("10.598 nanosecond").unwrap(), TimeUnit::Nanosecond * 10.598);
impl LowerExp for Duration
[src]
impl Mul<f32> for Duration
[src]
type Output = Duration
The resulting type after applying the *
operator.
pub fn mul(self, q: f32) -> Duration
[src]
impl Mul<f64> for Duration
[src]
type Output = Duration
The resulting type after applying the *
operator.
pub fn mul(self, q: f64) -> Duration
[src]
impl Mul<i16> for Duration
[src]
type Output = Duration
The resulting type after applying the *
operator.
pub fn mul(self, q: i16) -> Duration
[src]
impl Mul<i32> for Duration
[src]
type Output = Duration
The resulting type after applying the *
operator.
pub fn mul(self, q: i32) -> Duration
[src]
impl Mul<i64> for Duration
[src]
type Output = Duration
The resulting type after applying the *
operator.
pub fn mul(self, q: i64) -> Duration
[src]
impl Mul<i8> for Duration
[src]
type Output = Duration
The resulting type after applying the *
operator.
pub fn mul(self, q: i8) -> Duration
[src]
impl Mul<u128> for Duration
[src]
type Output = Duration
The resulting type after applying the *
operator.
pub fn mul(self, q: u128) -> Duration
[src]
impl Mul<u16> for Duration
[src]
type Output = Duration
The resulting type after applying the *
operator.
pub fn mul(self, q: u16) -> Duration
[src]
impl Mul<u32> for Duration
[src]
type Output = Duration
The resulting type after applying the *
operator.
pub fn mul(self, q: u32) -> Duration
[src]
impl Mul<u64> for Duration
[src]
type Output = Duration
The resulting type after applying the *
operator.
pub fn mul(self, q: u64) -> Duration
[src]
impl Mul<u8> for Duration
[src]
type Output = Duration
The resulting type after applying the *
operator.
pub fn mul(self, q: u8) -> Duration
[src]
impl Neg for Duration
[src]
type Output = Duration
The resulting type after applying the -
operator.
pub fn neg(self) -> <Duration as Neg>::Output
[src]
impl PartialEq<Duration> for Duration
[src]
impl PartialEq<TimeUnit> for Duration
[src]
pub fn eq(&self, unit: &TimeUnit) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Duration> for Duration
[src]
pub fn partial_cmp(&self, other: &Duration) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<TimeUnit> for Duration
[src]
pub fn partial_cmp(&self, unit: &TimeUnit) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralPartialEq for Duration
[src]
impl Sub<Duration> for Epoch
[src]
type Output = Epoch
The resulting type after applying the -
operator.
pub fn sub(self, duration: Duration) -> Epoch
[src]
impl Sub<Duration> for Duration
[src]
type Output = Duration
The resulting type after applying the -
operator.
pub fn sub(self, rhs: Duration) -> Duration
[src]
impl Sub<TimeUnit> for Duration
[src]
type Output = Duration
The resulting type after applying the -
operator.
pub fn sub(self, rhs: TimeUnit) -> Duration
[src]
impl SubAssign<Duration> for Duration
[src]
pub fn sub_assign(&mut self, rhs: Duration)
[src]
impl SubAssign<Duration> for Epoch
[src]
pub fn sub_assign(&mut self, duration: Duration)
[src]
impl SubAssign<TimeUnit> for Duration
[src]
pub fn sub_assign(&mut self, rhs: TimeUnit)
[src]
Auto Trait Implementations
impl RefUnwindSafe for Duration
impl Send for Duration
impl Sync for Duration
impl Unpin for Duration
impl UnwindSafe for Duration
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, Right> ClosedAdd<Right> for T where
T: Add<Right, Output = T> + AddAssign<Right>,
T: Add<Right, Output = T> + AddAssign<Right>,
impl<T> ClosedNeg for T where
T: Neg<Output = T>,
T: Neg<Output = T>,
impl<T, Right> ClosedSub<Right> for T where
T: Sub<Right, Output = T> + SubAssign<Right>,
T: Sub<Right, Output = T> + SubAssign<Right>,
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Scalar for T where
T: PartialEq<T> + Copy + Any + Debug,
[src]
T: PartialEq<T> + Copy + Any + Debug,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,