Struct uiuifree_actix_web_util::cookie::time::Duration
[−]pub struct Duration { /* private fields */ }Expand description
A span of time with nanosecond precision.
Each Duration is composed of a whole number of seconds and a fractional part represented in
nanoseconds.
This implementation allows for negative durations, unlike core::time::Duration.
Implementations
impl Duration
impl Duration
pub const ZERO: Duration = Self::seconds(0)
pub const ZERO: Duration = Self::seconds(0)
Equivalent to 0.seconds().
assert_eq!(Duration::ZERO, 0.seconds());pub const NANOSECOND: Duration = Self::nanoseconds(1)
pub const NANOSECOND: Duration = Self::nanoseconds(1)
Equivalent to 1.nanoseconds().
assert_eq!(Duration::NANOSECOND, 1.nanoseconds());pub const MICROSECOND: Duration = Self::microseconds(1)
pub const MICROSECOND: Duration = Self::microseconds(1)
Equivalent to 1.microseconds().
assert_eq!(Duration::MICROSECOND, 1.microseconds());pub const MILLISECOND: Duration = Self::milliseconds(1)
pub const MILLISECOND: Duration = Self::milliseconds(1)
Equivalent to 1.milliseconds().
assert_eq!(Duration::MILLISECOND, 1.milliseconds());pub const SECOND: Duration = Self::seconds(1)
pub const SECOND: Duration = Self::seconds(1)
Equivalent to 1.seconds().
assert_eq!(Duration::SECOND, 1.seconds());pub const MINUTE: Duration = Self::minutes(1)
pub const MINUTE: Duration = Self::minutes(1)
Equivalent to 1.minutes().
assert_eq!(Duration::MINUTE, 1.minutes());pub const HOUR: Duration = Self::hours(1)
pub const HOUR: Duration = Self::hours(1)
Equivalent to 1.hours().
assert_eq!(Duration::HOUR, 1.hours());pub const WEEK: Duration = Self::weeks(1)
pub const WEEK: Duration = Self::weeks(1)
Equivalent to 1.weeks().
assert_eq!(Duration::WEEK, 1.weeks());pub const MIN: Duration = Self::new_unchecked(i64::MIN, -999999999)
pub const MIN: Duration = Self::new_unchecked(i64::MIN, -999999999)
The minimum possible duration. Adding any negative duration to this will cause an overflow.
pub const MAX: Duration = Self::new_unchecked(i64::MAX, 999999999)
pub const MAX: Duration = Self::new_unchecked(i64::MAX, 999999999)
The maximum possible duration. Adding any positive duration to this will cause an overflow.
pub const fn is_zero(self) -> bool
pub const fn is_zero(self) -> bool
Check if a duration is exactly zero.
assert!(0.seconds().is_zero());
assert!(!1.nanoseconds().is_zero());pub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
Check if a duration is negative.
assert!((-1).seconds().is_negative());
assert!(!0.seconds().is_negative());
assert!(!1.seconds().is_negative());pub const fn is_positive(self) -> bool
pub const fn is_positive(self) -> bool
Check if a duration is positive.
assert!(1.seconds().is_positive());
assert!(!0.seconds().is_positive());
assert!(!(-1).seconds().is_positive());pub const fn abs(self) -> Duration
pub const fn abs(self) -> Duration
Get the absolute value of the duration.
This method saturates the returned value if it would otherwise overflow.
assert_eq!(1.seconds().abs(), 1.seconds());
assert_eq!(0.seconds().abs(), 0.seconds());
assert_eq!((-1).seconds().abs(), 1.seconds());pub fn unsigned_abs(self) -> Duration
pub fn unsigned_abs(self) -> Duration
Convert the existing Duration to a std::time::Duration and its sign. This returns a
std::time::Duration and does not saturate the returned value (unlike Duration::abs).
assert_eq!(1.seconds().unsigned_abs(), 1.std_seconds());
assert_eq!(0.seconds().unsigned_abs(), 0.std_seconds());
assert_eq!((-1).seconds().unsigned_abs(), 1.std_seconds());pub const fn new(seconds: i64, nanoseconds: i32) -> Duration
pub const fn new(seconds: i64, nanoseconds: i32) -> Duration
Create a new Duration with the provided seconds and nanoseconds. If nanoseconds is at
least ±109, it will wrap to the number of seconds.
assert_eq!(Duration::new(1, 0), 1.seconds());
assert_eq!(Duration::new(-1, 0), (-1).seconds());
assert_eq!(Duration::new(1, 2_000_000_000), 3.seconds());pub const fn weeks(weeks: i64) -> Duration
pub const fn weeks(weeks: i64) -> Duration
Create a new Duration with the given number of weeks. Equivalent to
Duration::seconds(weeks * 604_800).
assert_eq!(Duration::weeks(1), 604_800.seconds());pub const fn days(days: i64) -> Duration
pub const fn days(days: i64) -> Duration
Create a new Duration with the given number of days. Equivalent to
Duration::seconds(days * 86_400).
assert_eq!(Duration::days(1), 86_400.seconds());pub const fn hours(hours: i64) -> Duration
pub const fn hours(hours: i64) -> Duration
Create a new Duration with the given number of hours. Equivalent to
Duration::seconds(hours * 3_600).
assert_eq!(Duration::hours(1), 3_600.seconds());pub const fn minutes(minutes: i64) -> Duration
pub const fn minutes(minutes: i64) -> Duration
Create a new Duration with the given number of minutes. Equivalent to
Duration::seconds(minutes * 60).
assert_eq!(Duration::minutes(1), 60.seconds());pub const fn seconds(seconds: i64) -> Duration
pub const fn seconds(seconds: i64) -> Duration
Create a new Duration with the given number of seconds.
assert_eq!(Duration::seconds(1), 1_000.milliseconds());pub fn seconds_f64(seconds: f64) -> Duration
pub fn seconds_f64(seconds: f64) -> Duration
Creates a new Duration from the specified number of seconds represented as f64.
assert_eq!(Duration::seconds_f64(0.5), 0.5.seconds());
assert_eq!(Duration::seconds_f64(-0.5), -0.5.seconds());pub fn seconds_f32(seconds: f32) -> Duration
pub fn seconds_f32(seconds: f32) -> Duration
Creates a new Duration from the specified number of seconds represented as f32.
assert_eq!(Duration::seconds_f32(0.5), 0.5.seconds());
assert_eq!(Duration::seconds_f32(-0.5), (-0.5).seconds());pub const fn milliseconds(milliseconds: i64) -> Duration
pub const fn milliseconds(milliseconds: i64) -> Duration
Create a new Duration with the given number of milliseconds.
assert_eq!(Duration::milliseconds(1), 1_000.microseconds());
assert_eq!(Duration::milliseconds(-1), (-1_000).microseconds());pub const fn microseconds(microseconds: i64) -> Duration
pub const fn microseconds(microseconds: i64) -> Duration
Create a new Duration with the given number of microseconds.
assert_eq!(Duration::microseconds(1), 1_000.nanoseconds());
assert_eq!(Duration::microseconds(-1), (-1_000).nanoseconds());pub const fn nanoseconds(nanoseconds: i64) -> Duration
pub const fn nanoseconds(nanoseconds: i64) -> Duration
Create a new Duration with the given number of nanoseconds.
assert_eq!(Duration::nanoseconds(1), 1.microseconds() / 1_000);
assert_eq!(Duration::nanoseconds(-1), (-1).microseconds() / 1_000);pub const fn whole_weeks(self) -> i64
pub const fn whole_weeks(self) -> i64
Get the number of whole weeks in the duration.
assert_eq!(1.weeks().whole_weeks(), 1);
assert_eq!((-1).weeks().whole_weeks(), -1);
assert_eq!(6.days().whole_weeks(), 0);
assert_eq!((-6).days().whole_weeks(), 0);pub const fn whole_days(self) -> i64
pub const fn whole_days(self) -> i64
Get the number of whole days in the duration.
assert_eq!(1.days().whole_days(), 1);
assert_eq!((-1).days().whole_days(), -1);
assert_eq!(23.hours().whole_days(), 0);
assert_eq!((-23).hours().whole_days(), 0);pub const fn whole_hours(self) -> i64
pub const fn whole_hours(self) -> i64
Get the number of whole hours in the duration.
assert_eq!(1.hours().whole_hours(), 1);
assert_eq!((-1).hours().whole_hours(), -1);
assert_eq!(59.minutes().whole_hours(), 0);
assert_eq!((-59).minutes().whole_hours(), 0);pub const fn whole_minutes(self) -> i64
pub const fn whole_minutes(self) -> i64
Get the number of whole minutes in the duration.
assert_eq!(1.minutes().whole_minutes(), 1);
assert_eq!((-1).minutes().whole_minutes(), -1);
assert_eq!(59.seconds().whole_minutes(), 0);
assert_eq!((-59).seconds().whole_minutes(), 0);pub const fn whole_seconds(self) -> i64
pub const fn whole_seconds(self) -> i64
Get the number of whole seconds in the duration.
assert_eq!(1.seconds().whole_seconds(), 1);
assert_eq!((-1).seconds().whole_seconds(), -1);
assert_eq!(1.minutes().whole_seconds(), 60);
assert_eq!((-1).minutes().whole_seconds(), -60);pub fn as_seconds_f64(self) -> f64
pub fn as_seconds_f64(self) -> f64
Get the number of fractional seconds in the duration.
assert_eq!(1.5.seconds().as_seconds_f64(), 1.5);
assert_eq!((-1.5).seconds().as_seconds_f64(), -1.5);pub fn as_seconds_f32(self) -> f32
pub fn as_seconds_f32(self) -> f32
Get the number of fractional seconds in the duration.
assert_eq!(1.5.seconds().as_seconds_f32(), 1.5);
assert_eq!((-1.5).seconds().as_seconds_f32(), -1.5);pub const fn whole_milliseconds(self) -> i128
pub const fn whole_milliseconds(self) -> i128
Get the number of whole milliseconds in the duration.
assert_eq!(1.seconds().whole_milliseconds(), 1_000);
assert_eq!((-1).seconds().whole_milliseconds(), -1_000);
assert_eq!(1.milliseconds().whole_milliseconds(), 1);
assert_eq!((-1).milliseconds().whole_milliseconds(), -1);pub const fn subsec_milliseconds(self) -> i16
pub const fn subsec_milliseconds(self) -> i16
Get the number of milliseconds past the number of whole seconds.
Always in the range -1_000..1_000.
assert_eq!(1.4.seconds().subsec_milliseconds(), 400);
assert_eq!((-1.4).seconds().subsec_milliseconds(), -400);pub const fn whole_microseconds(self) -> i128
pub const fn whole_microseconds(self) -> i128
Get the number of whole microseconds in the duration.
assert_eq!(1.milliseconds().whole_microseconds(), 1_000);
assert_eq!((-1).milliseconds().whole_microseconds(), -1_000);
assert_eq!(1.microseconds().whole_microseconds(), 1);
assert_eq!((-1).microseconds().whole_microseconds(), -1);pub const fn subsec_microseconds(self) -> i32
pub const fn subsec_microseconds(self) -> i32
Get the number of microseconds past the number of whole seconds.
Always in the range -1_000_000..1_000_000.
assert_eq!(1.0004.seconds().subsec_microseconds(), 400);
assert_eq!((-1.0004).seconds().subsec_microseconds(), -400);pub const fn whole_nanoseconds(self) -> i128
pub const fn whole_nanoseconds(self) -> i128
Get the number of nanoseconds in the duration.
assert_eq!(1.microseconds().whole_nanoseconds(), 1_000);
assert_eq!((-1).microseconds().whole_nanoseconds(), -1_000);
assert_eq!(1.nanoseconds().whole_nanoseconds(), 1);
assert_eq!((-1).nanoseconds().whole_nanoseconds(), -1);pub const fn subsec_nanoseconds(self) -> i32
pub const fn subsec_nanoseconds(self) -> i32
Get the number of nanoseconds past the number of whole seconds.
The returned value will always be in the range -1_000_000_000..1_000_000_000.
assert_eq!(1.000_000_400.seconds().subsec_nanoseconds(), 400);
assert_eq!((-1.000_000_400).seconds().subsec_nanoseconds(), -400);pub const fn checked_add(self, rhs: Duration) -> Option<Duration>
pub const fn checked_add(self, rhs: Duration) -> Option<Duration>
Computes self + rhs, returning None if an overflow occurred.
assert_eq!(5.seconds().checked_add(5.seconds()), Some(10.seconds()));
assert_eq!(Duration::MAX.checked_add(1.nanoseconds()), None);
assert_eq!((-5).seconds().checked_add(5.seconds()), Some(0.seconds()));pub const fn checked_sub(self, rhs: Duration) -> Option<Duration>
pub const fn checked_sub(self, rhs: Duration) -> Option<Duration>
Computes self - rhs, returning None if an overflow occurred.
assert_eq!(5.seconds().checked_sub(5.seconds()), Some(Duration::ZERO));
assert_eq!(Duration::MIN.checked_sub(1.nanoseconds()), None);
assert_eq!(5.seconds().checked_sub(10.seconds()), Some((-5).seconds()));pub const fn checked_mul(self, rhs: i32) -> Option<Duration>
pub const fn checked_mul(self, rhs: i32) -> Option<Duration>
Computes self * rhs, returning None if an overflow occurred.
assert_eq!(5.seconds().checked_mul(2), Some(10.seconds()));
assert_eq!(5.seconds().checked_mul(-2), Some((-10).seconds()));
assert_eq!(5.seconds().checked_mul(0), Some(0.seconds()));
assert_eq!(Duration::MAX.checked_mul(2), None);
assert_eq!(Duration::MIN.checked_mul(2), None);pub const fn checked_div(self, rhs: i32) -> Option<Duration>
pub const fn checked_div(self, rhs: i32) -> Option<Duration>
Computes self / rhs, returning None if rhs == 0 or if the result would overflow.
assert_eq!(10.seconds().checked_div(2), Some(5.seconds()));
assert_eq!(10.seconds().checked_div(-2), Some((-5).seconds()));
assert_eq!(1.seconds().checked_div(0), None);pub const fn saturating_add(self, rhs: Duration) -> Duration
pub const fn saturating_add(self, rhs: Duration) -> Duration
Computes self + rhs, saturating if an overflow occurred.
assert_eq!(5.seconds().saturating_add(5.seconds()), 10.seconds());
assert_eq!(Duration::MAX.saturating_add(1.nanoseconds()), Duration::MAX);
assert_eq!(
Duration::MIN.saturating_add((-1).nanoseconds()),
Duration::MIN
);
assert_eq!((-5).seconds().saturating_add(5.seconds()), Duration::ZERO);pub const fn saturating_sub(self, rhs: Duration) -> Duration
pub const fn saturating_sub(self, rhs: Duration) -> Duration
Computes self - rhs, saturating if an overflow occurred.
assert_eq!(5.seconds().saturating_sub(5.seconds()), Duration::ZERO);
assert_eq!(Duration::MIN.saturating_sub(1.nanoseconds()), Duration::MIN);
assert_eq!(
Duration::MAX.saturating_sub((-1).nanoseconds()),
Duration::MAX
);
assert_eq!(5.seconds().saturating_sub(10.seconds()), (-5).seconds());pub const fn saturating_mul(self, rhs: i32) -> Duration
pub const fn saturating_mul(self, rhs: i32) -> Duration
Computes self * rhs, saturating if an overflow occurred.
assert_eq!(5.seconds().saturating_mul(2), 10.seconds());
assert_eq!(5.seconds().saturating_mul(-2), (-10).seconds());
assert_eq!(5.seconds().saturating_mul(0), Duration::ZERO);
assert_eq!(Duration::MAX.saturating_mul(2), Duration::MAX);
assert_eq!(Duration::MIN.saturating_mul(2), Duration::MIN);
assert_eq!(Duration::MAX.saturating_mul(-2), Duration::MIN);
assert_eq!(Duration::MIN.saturating_mul(-2), Duration::MAX);Trait Implementations
impl Add<Duration> for PrimitiveDateTime
impl Add<Duration> for PrimitiveDateTime
type Output = PrimitiveDateTime
type Output = PrimitiveDateTime
The resulting type after applying the + operator.
impl Add<Duration> for Time
impl Add<Duration> for Time
impl AddAssign<Duration> for Date
impl AddAssign<Duration> for Date
fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the += operation. Read more
impl AddAssign<Duration> for Duration
impl AddAssign<Duration> for Duration
fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the += operation. Read more
impl AddAssign<Duration> for Duration
impl AddAssign<Duration> for Duration
fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the += operation. Read more
impl AddAssign<Duration> for Instant
impl AddAssign<Duration> for Instant
fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the += operation. Read more
impl AddAssign<Duration> for OffsetDateTime
impl AddAssign<Duration> for OffsetDateTime
fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the += operation. Read more
impl AddAssign<Duration> for PrimitiveDateTime
impl AddAssign<Duration> for PrimitiveDateTime
fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the += operation. Read more
impl AddAssign<Duration> for Time
impl AddAssign<Duration> for Time
fn add_assign(&mut self, rhs: Duration)
fn add_assign(&mut self, rhs: Duration)
Performs the += operation. Read more
impl Display for Duration
impl Display for Duration
The format returned by this implementation is not stable and must not be relied upon.
By default this produces an exact, full-precision printout of the duration.
For a concise, rounded printout instead, you can use the .N format specifier:
let duration = Duration::new(123456, 789011223);
println!("{:.3}", duration);For the purposes of this implementation, a day is exactly 24 hours and a minute is exactly 60 seconds.
impl DivAssign<f32> for Duration
impl DivAssign<f32> for Duration
fn div_assign(&mut self, rhs: f32)
fn div_assign(&mut self, rhs: f32)
Performs the /= operation. Read more
impl DivAssign<f64> for Duration
impl DivAssign<f64> for Duration
fn div_assign(&mut self, rhs: f64)
fn div_assign(&mut self, rhs: f64)
Performs the /= operation. Read more
impl DivAssign<i16> for Duration
impl DivAssign<i16> for Duration
fn div_assign(&mut self, rhs: i16)
fn div_assign(&mut self, rhs: i16)
Performs the /= operation. Read more
impl DivAssign<i32> for Duration
impl DivAssign<i32> for Duration
fn div_assign(&mut self, rhs: i32)
fn div_assign(&mut self, rhs: i32)
Performs the /= operation. Read more
impl DivAssign<i8> for Duration
impl DivAssign<i8> for Duration
fn div_assign(&mut self, rhs: i8)
fn div_assign(&mut self, rhs: i8)
Performs the /= operation. Read more
impl DivAssign<u16> for Duration
impl DivAssign<u16> for Duration
fn div_assign(&mut self, rhs: u16)
fn div_assign(&mut self, rhs: u16)
Performs the /= operation. Read more
impl DivAssign<u32> for Duration
impl DivAssign<u32> for Duration
fn div_assign(&mut self, rhs: u32)
fn div_assign(&mut self, rhs: u32)
Performs the /= operation. Read more
impl DivAssign<u8> for Duration
impl DivAssign<u8> for Duration
fn div_assign(&mut self, rhs: u8)
fn div_assign(&mut self, rhs: u8)
Performs the /= operation. Read more
sourceimpl FromValue for Duration
impl FromValue for Duration
type Intermediate = ParseIr<Duration>
sourcefn from_value(v: Value) -> Self
fn from_value(v: Value) -> Self
Will panic if could not convert v to Self.
sourcefn from_value_opt(v: Value) -> Result<Self, FromValueError>
fn from_value_opt(v: Value) -> Result<Self, FromValueError>
Will return Err(Error::FromValueError(v)) if could not convert v to Self.
sourcefn get_intermediate(v: Value) -> Result<Self::Intermediate, FromValueError>
fn get_intermediate(v: Value) -> Result<Self::Intermediate, FromValueError>
Will return Err(Error::FromValueError(v)) if v is not convertible to Self.
impl MulAssign<f32> for Duration
impl MulAssign<f32> for Duration
fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
Performs the *= operation. Read more
impl MulAssign<f64> for Duration
impl MulAssign<f64> for Duration
fn mul_assign(&mut self, rhs: f64)
fn mul_assign(&mut self, rhs: f64)
Performs the *= operation. Read more
impl MulAssign<i16> for Duration
impl MulAssign<i16> for Duration
fn mul_assign(&mut self, rhs: i16)
fn mul_assign(&mut self, rhs: i16)
Performs the *= operation. Read more
impl MulAssign<i32> for Duration
impl MulAssign<i32> for Duration
fn mul_assign(&mut self, rhs: i32)
fn mul_assign(&mut self, rhs: i32)
Performs the *= operation. Read more
impl MulAssign<i8> for Duration
impl MulAssign<i8> for Duration
fn mul_assign(&mut self, rhs: i8)
fn mul_assign(&mut self, rhs: i8)
Performs the *= operation. Read more
impl MulAssign<u16> for Duration
impl MulAssign<u16> for Duration
fn mul_assign(&mut self, rhs: u16)
fn mul_assign(&mut self, rhs: u16)
Performs the *= operation. Read more
impl MulAssign<u32> for Duration
impl MulAssign<u32> for Duration
fn mul_assign(&mut self, rhs: u32)
fn mul_assign(&mut self, rhs: u32)
Performs the *= operation. Read more
impl MulAssign<u8> for Duration
impl MulAssign<u8> for Duration
fn mul_assign(&mut self, rhs: u8)
fn mul_assign(&mut self, rhs: u8)
Performs the *= operation. Read more
impl Ord for Duration
impl Ord for Duration
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
impl PartialOrd<Duration> for Duration
impl PartialOrd<Duration> for Duration
fn partial_cmp(&self, other: &Duration) -> Option<Ordering>
fn partial_cmp(&self, other: &Duration) -> 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
impl PartialOrd<Duration> for Duration
impl PartialOrd<Duration> for Duration
fn partial_cmp(&self, rhs: &Duration) -> Option<Ordering>
fn partial_cmp(&self, rhs: &Duration) -> 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
impl Sub<Duration> for PrimitiveDateTime
impl Sub<Duration> for PrimitiveDateTime
type Output = PrimitiveDateTime
type Output = PrimitiveDateTime
The resulting type after applying the - operator.
impl Sub<Duration> for Time
impl Sub<Duration> for Time
impl SubAssign<Duration> for Date
impl SubAssign<Duration> for Date
fn sub_assign(&mut self, rhs: Duration)
fn sub_assign(&mut self, rhs: Duration)
Performs the -= operation. Read more
impl SubAssign<Duration> for Duration
impl SubAssign<Duration> for Duration
fn sub_assign(&mut self, rhs: Duration)
fn sub_assign(&mut self, rhs: Duration)
Performs the -= operation. Read more
impl SubAssign<Duration> for Duration
impl SubAssign<Duration> for Duration
fn sub_assign(&mut self, rhs: Duration)
fn sub_assign(&mut self, rhs: Duration)
Performs the -= operation. Read more
impl SubAssign<Duration> for Instant
impl SubAssign<Duration> for Instant
fn sub_assign(&mut self, rhs: Duration)
fn sub_assign(&mut self, rhs: Duration)
Performs the -= operation. Read more
impl SubAssign<Duration> for OffsetDateTime
impl SubAssign<Duration> for OffsetDateTime
fn sub_assign(&mut self, rhs: Duration)
fn sub_assign(&mut self, rhs: Duration)
Performs the -= operation. Read more
impl SubAssign<Duration> for PrimitiveDateTime
impl SubAssign<Duration> for PrimitiveDateTime
fn sub_assign(&mut self, rhs: Duration)
fn sub_assign(&mut self, rhs: Duration)
Performs the -= operation. Read more
impl SubAssign<Duration> for Time
impl SubAssign<Duration> for Time
fn sub_assign(&mut self, rhs: Duration)
fn sub_assign(&mut self, rhs: Duration)
Performs the -= operation. Read more
impl TryFrom<Duration> for Duration
impl TryFrom<Duration> for Duration
type Error = ConversionRange
type Error = ConversionRange
The type returned in the event of a conversion error.
fn try_from(original: Duration) -> Result<Duration, ConversionRange>
fn try_from(original: Duration) -> Result<Duration, ConversionRange>
Performs the conversion.
impl Copy for Duration
impl Eq for Duration
impl StructuralEq for Duration
impl StructuralPartialEq for Duration
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
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
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key and return true if they are equal.
impl<T> FmtForward for T
impl<T> FmtForward for T
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Causes self to use its Binary implementation when Debug-formatted.
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Causes self to use its Display implementation when
Debug-formatted. Read more
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Causes self to use its LowerExp implementation when
Debug-formatted. Read more
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Causes self to use its LowerHex implementation when
Debug-formatted. Read more
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Causes self to use its Octal implementation when Debug-formatted.
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Causes self to use its Pointer implementation when
Debug-formatted. Read more
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Causes self to use its UpperExp implementation when
Debug-formatted. Read more
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Causes self to use its UpperHex implementation when
Debug-formatted. Read more
sourceimpl<T> FromRow for T where
T: FromValue,
impl<T> FromRow for T where
T: FromValue,
fn from_row_opt(row: Row) -> Result<T, FromRowError>
fn from_row(row: Row) -> Self
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T, U, I> LiftInto<U, I> for T where
U: LiftFrom<T, I>,
impl<T, U, I> LiftInto<U, I> for T where
U: LiftFrom<T, I>,
fn lift_into(self) -> U
fn lift_into(self) -> U
Performs the indexed conversion.
impl<T> Pipe for T where
T: ?Sized,
impl<T> Pipe for T where
T: ?Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
Pipes by value. This is generally the method you want to use. Read more
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
Borrows self and passes that borrow into the pipe function. Read more
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
Mutably borrows self and passes that borrow into the pipe function. Read more
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
Borrows self, then passes self.borrow() into the pipe function. Read more
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
Mutably borrows self, then passes self.borrow_mut() into the pipe
function. Read more
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
Borrows self, then passes self.as_ref() into the pipe function.
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
Mutably borrows self, then passes self.as_mut() into the pipe
function. Read more
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
Borrows self, then passes self.deref() into the pipe function.
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Tap for T
impl<T> Tap for T
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Immutable access to the Borrow<B> of a value. Read more
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Mutable access to the BorrowMut<B> of a value. Read more
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Immutable access to the AsRef<R> view of a value. Read more
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Mutable access to the AsMut<R> view of a value. Read more
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Immutable access to the Deref::Target of a value. Read more
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Mutable access to the Deref::Target of a value. Read more
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls .tap() only in debug builds, and is erased in release builds.
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls .tap_mut() only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Calls .tap_borrow() only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Calls .tap_borrow_mut() only in debug builds, and is erased in release
builds. Read more
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Calls .tap_ref() only in debug builds, and is erased in release
builds. Read more
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Calls .tap_ref_mut() only in debug builds, and is erased in release
builds. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more