pub struct Signed { /* private fields */ }Expand description
A signed difference between two instants. The domain itself is unsigned
(Rule Z, N12), so this type exists to let Instant::between be total.
Implementations§
Source§impl Signed
impl Signed
Sourcepub fn new(sign: Sign, mag: Delta) -> Self
pub fn new(sign: Sign, mag: Delta) -> Self
Construct from a sign and magnitude. A zero magnitude is normalised to
positive, so Signed has no negative zero.
Sourcepub fn into_magnitude(self) -> Delta
pub fn into_magnitude(self) -> Delta
The magnitude, discarding the sign. Named so that dropping the sign is a visible act at the call site.
Trait Implementations§
impl Copy for Signed
impl Eq for Signed
Source§impl Ord for Signed
impl Ord for Signed
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Signed
impl PartialOrd for Signed
impl StructuralPartialEq for Signed
Auto Trait Implementations§
impl Freeze for Signed
impl RefUnwindSafe for Signed
impl Send for Signed
impl Sync for Signed
impl Unpin for Signed
impl UnsafeUnpin for Signed
impl UnwindSafe for Signed
Blanket Implementations§
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