[−][src]Struct geom::Duration
A duration, in seconds. Can be negative.
Implementations
impl Duration
[src]
pub const ZERO: Duration
[src]
const EPSILON: Duration
[src]
pub fn seconds(value: f64) -> Duration
[src]
Creates a duration in seconds.
pub fn minutes(mins: usize) -> Duration
[src]
Creates a duration in minutes.
pub fn hours(hours: usize) -> Duration
[src]
Creates a duration in hours.
pub fn f64_minutes(mins: f64) -> Duration
[src]
Creates a duration in minutes.
pub const fn const_seconds(value: f64) -> Duration
[src]
pub(crate) fn to_u64(self) -> u64
[src]
pub(crate) fn from_u64(x: u64) -> Duration
[src]
pub fn inner_seconds(self) -> f64
[src]
Returns the duration in seconds. Prefer working in typesafe Duration
s.
fn get_parts(self) -> (usize, usize, usize, usize)
[src]
Splits the duration into (hours, minutes, seconds, centiseconds).
pub fn parse(string: &str) -> Result<Duration>
[src]
Parses a duration such as "3:00" to Duration::minutes(3)
.
pub fn epsilon_eq(self, other: Duration) -> bool
[src]
If two durations are within this amount, they'll print as if they're the same.
pub fn realtime_elapsed(since: Instant) -> Duration
[src]
Returns the duration elapsed from this moment in real time.
pub fn round_up(self, multiple: Duration) -> Duration
[src]
Rounds a duration up to the nearest whole number multiple.
pub fn num_minutes_rounded_up(self) -> usize
[src]
Returns the duration as a number of minutes, rounded up.
pub fn make_intervals_for_max(self, num_labels: usize) -> (Duration, Vec<usize>)
[src]
Returns (rounded max, the boundaries in number of minutes)
pub fn to_string(self, fmt: &UnitFmt) -> String
[src]
Describes the duration according to formatting rules.
pub fn max(self, other: Duration) -> Duration
[src]
Returns the largest of the two inputs.
pub fn min(self, other: Duration) -> Duration
[src]
Returns the smallest of the two inputs.
Trait Implementations
impl Add<Duration> for Duration
[src]
type Output = Duration
The resulting type after applying the +
operator.
fn add(self, other: Duration) -> Duration
[src]
impl Add<Duration> for Time
[src]
type Output = Time
The resulting type after applying the +
operator.
fn add(self, other: Duration) -> Time
[src]
impl AddAssign<Duration> for Duration
[src]
fn add_assign(&mut self, other: Duration)
[src]
impl AddAssign<Duration> for Time
[src]
fn add_assign(&mut self, other: Duration)
[src]
impl Clone for Duration
[src]
impl Copy for Duration
[src]
impl Debug for Duration
[src]
impl Default for Duration
[src]
impl<'de> Deserialize<'de> for Duration
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for Duration
[src]
impl Div<Duration> for Duration
[src]
type Output = f64
The resulting type after applying the /
operator.
fn div(self, other: Duration) -> f64
[src]
impl Div<f64> for Duration
[src]
type Output = Duration
The resulting type after applying the /
operator.
fn div(self, other: f64) -> Duration
[src]
impl Eq for Duration
[src]
impl HgramValue<Duration> for Duration
[src]
impl Mul<Duration> for f64
[src]
type Output = Duration
The resulting type after applying the *
operator.
fn mul(self, other: Duration) -> Duration
[src]
impl Mul<Duration> for Speed
[src]
type Output = Distance
The resulting type after applying the *
operator.
fn mul(self, other: Duration) -> Distance
[src]
impl Mul<Speed> for Duration
[src]
type Output = Distance
The resulting type after applying the *
operator.
fn mul(self, other: Speed) -> Distance
[src]
impl Mul<f64> for Duration
[src]
type Output = Duration
The resulting type after applying the *
operator.
fn mul(self, other: f64) -> Duration
[src]
impl Ord for Duration
[src]
fn cmp(&self, other: &Duration) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Duration> for Duration
[src]
impl PartialOrd<Duration> for Duration
[src]
fn partial_cmp(&self, other: &Duration) -> Option<Ordering>
[src]
fn lt(&self, other: &Duration) -> bool
[src]
fn le(&self, other: &Duration) -> bool
[src]
fn gt(&self, other: &Duration) -> bool
[src]
fn ge(&self, other: &Duration) -> bool
[src]
impl Rem<Duration> for Duration
[src]
type Output = Duration
The resulting type after applying the %
operator.
fn rem(self, other: Duration) -> Duration
[src]
impl Serialize for Duration
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Duration
[src]
impl Sub<Duration> for Duration
[src]
type Output = Duration
The resulting type after applying the -
operator.
fn sub(self, other: Duration) -> Duration
[src]
impl Sub<Duration> for Time
[src]
type Output = Time
The resulting type after applying the -
operator.
fn sub(self, other: Duration) -> Time
[src]
impl SubAssign<Duration> for Duration
[src]
fn sub_assign(&mut self, other: Duration)
[src]
impl Sum<Duration> for Duration
[src]
Auto Trait Implementations
impl RefUnwindSafe for Duration
[src]
impl Send for Duration
[src]
impl Sync for Duration
[src]
impl Unpin for Duration
[src]
impl UnwindSafe for Duration
[src]
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> 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> Same<T> for T
type Output = T
Should always be Self
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>,