Enum time::Sign [−][src]
#[repr(i8)] pub enum Sign { Positive, Negative, Zero, }
Expand description
Variants
A positive value.
A negative value.
A value that is exactly zero.
Implementations
impl Sign
[src]
impl Sign
[src]pub fn negate(self) -> Self
[src]
pub fn negate(self) -> Self
[src]Return the opposite of the current sign.
assert_eq!(Sign::Positive.negate(), Sign::Negative); assert_eq!(Sign::Negative.negate(), Sign::Positive); assert_eq!(Sign::Zero.negate(), Sign::Zero);
pub const fn is_positive(self) -> bool
[src]
pub const fn is_positive(self) -> bool
[src]Is the sign positive?
assert!(Sign::Positive.is_positive()); assert!(!Sign::Negative.is_positive()); assert!(!Sign::Zero.is_positive());
pub const fn is_negative(self) -> bool
[src]
pub const fn is_negative(self) -> bool
[src]Is the sign negative?
assert!(!Sign::Positive.is_negative()); assert!(Sign::Negative.is_negative()); assert!(!Sign::Zero.is_negative());
Trait Implementations
impl DivAssign<Sign> for Sign
[src]
impl DivAssign<Sign> for Sign
[src]fn div_assign(&mut self, rhs: Self)
[src]
fn div_assign(&mut self, rhs: Self)
[src]Performs the /=
operation. Read more
impl MulAssign<Sign> for Sign
[src]
impl MulAssign<Sign> for Sign
[src]fn mul_assign(&mut self, rhs: Self)
[src]
fn mul_assign(&mut self, rhs: Self)
[src]Performs the *=
operation. Read more
impl Copy for Sign
[src]
impl Eq for Sign
[src]
impl StructuralEq for Sign
[src]
impl StructuralPartialEq for Sign
[src]
Auto Trait Implementations
impl RefUnwindSafe for Sign
impl Send for Sign
impl Sync for Sign
impl Unpin for Sign
impl UnwindSafe for Sign
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more