pub enum SignedDuration {
Positive(Duration),
Negative(Duration),
}
Expand description
A Duration
that can be either negative or positive.
Variants§
Positive(Duration)
A duration representing a positive measurement of time.
Negative(Duration)
A duration representing a negative measurement of time.
Implementations§
§impl SignedDuration
impl SignedDuration
pub fn checked_add(self, other: SignedDuration) -> Option<SignedDuration>
pub fn checked_add(self, other: SignedDuration) -> Option<SignedDuration>
Adds the two durations, honoring the signs, and returns the result if the duration is representable.
Trait Implementations§
§impl Clone for SignedDuration
impl Clone for SignedDuration
§fn clone(&self) -> SignedDuration
fn clone(&self) -> SignedDuration
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for SignedDuration
impl Debug for SignedDuration
§impl PartialEq<SignedDuration> for SignedDuration
impl PartialEq<SignedDuration> for SignedDuration
§fn eq(&self, other: &SignedDuration) -> bool
fn eq(&self, other: &SignedDuration) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl Sum<SignedDuration> for Option<SignedDuration>
impl Sum<SignedDuration> for Option<SignedDuration>
§fn sum<I>(iter: I) -> Option<SignedDuration>where
I: Iterator<Item = SignedDuration>,
fn sum<I>(iter: I) -> Option<SignedDuration>where I: Iterator<Item = SignedDuration>,
Method which takes an iterator and generates
Self
from the elements by
“summing up” the items.§impl Sum<SignedDuration> for SignedDuration
impl Sum<SignedDuration> for SignedDuration
§fn sum<I>(iter: I) -> SignedDurationwhere
I: Iterator<Item = SignedDuration>,
fn sum<I>(iter: I) -> SignedDurationwhere I: Iterator<Item = SignedDuration>,
Method which takes an iterator and generates
Self
from the elements by
“summing up” the items.§impl<Resolution> TryFrom<LimitedResolutionDuration<Resolution>> for SignedDurationwhere
Resolution: TimeResolution,
impl<Resolution> TryFrom<LimitedResolutionDuration<Resolution>> for SignedDurationwhere Resolution: TimeResolution,
§fn try_from(
value: LimitedResolutionDuration<Resolution>
) -> Result<SignedDuration, <SignedDuration as TryFrom<LimitedResolutionDuration<Resolution>>>::Error>
fn try_from( value: LimitedResolutionDuration<Resolution> ) -> Result<SignedDuration, <SignedDuration as TryFrom<LimitedResolutionDuration<Resolution>>>::Error>
Performs the conversion.
§impl<Resolution> TryFrom<SignedDuration> for LimitedResolutionDuration<Resolution>where
Resolution: TimeResolution,
impl<Resolution> TryFrom<SignedDuration> for LimitedResolutionDuration<Resolution>where Resolution: TimeResolution,
§fn try_from(
duration: SignedDuration
) -> Result<LimitedResolutionDuration<Resolution>, <LimitedResolutionDuration<Resolution> as TryFrom<SignedDuration>>::Error>
fn try_from( duration: SignedDuration ) -> Result<LimitedResolutionDuration<Resolution>, <LimitedResolutionDuration<Resolution> as TryFrom<SignedDuration>>::Error>
Performs the conversion.
impl Copy for SignedDuration
impl Eq for SignedDuration
impl StructuralEq for SignedDuration
impl StructuralPartialEq for SignedDuration
Auto Trait Implementations§
impl RefUnwindSafe for SignedDuration
impl Send for SignedDuration
impl Sync for SignedDuration
impl Unpin for SignedDuration
impl UnwindSafe for SignedDuration
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.