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§
source§impl SignedDuration
impl SignedDuration
sourcepub 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§
source§impl Clone for SignedDuration
impl Clone for SignedDuration
source§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 moresource§impl Debug for SignedDuration
impl Debug for SignedDuration
source§impl PartialEq for SignedDuration
impl PartialEq for SignedDuration
source§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 ==
.source§impl Sum<SignedDuration> for Option<SignedDuration>
impl Sum<SignedDuration> for Option<SignedDuration>
source§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.source§impl Sum for SignedDuration
impl Sum for SignedDuration
source§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.source§impl<Resolution> TryFrom<LimitedResolutionDuration<Resolution>> for SignedDurationwhere
Resolution: TimeResolution,
impl<Resolution> TryFrom<LimitedResolutionDuration<Resolution>> for SignedDurationwhere
Resolution: TimeResolution,
source§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.
source§impl<Resolution> TryFrom<SignedDuration> for LimitedResolutionDuration<Resolution>where
Resolution: TimeResolution,
impl<Resolution> TryFrom<SignedDuration> for LimitedResolutionDuration<Resolution>where
Resolution: TimeResolution,
source§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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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 Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.