pub enum Sign {
Negative = -1,
Zero = 0,
Positive = 1,
}Expand description
Variantsยง
Negative = -1
A negative sign (-).
Zero = 0
The zero sign (0). (The default)
Positive = 1
A positive sign (+).
Implementationsยง
Sourceยงimpl Sign
impl Sign
Sourcepub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
True if self is Negative.
Sourcepub const fn is_positive(self) -> bool
pub const fn is_positive(self) -> bool
True if self is Positive.
Sourcepub const fn is_nonzero(self) -> bool
pub const fn is_nonzero(self) -> bool
True if self is not Zero.
Sourcepub const fn same_direction(self, other: Self) -> bool
pub const fn same_direction(self, other: Self) -> bool
Returns true if both have the same non-zero direction.
Sourcepub const fn pow(self, n: u32) -> Self
pub const fn pow(self, n: u32) -> Self
Raises the sign to n with zero-dominance: oddโsame, evenโPositive.
Sourcepub fn fold<I: IntoIterator<Item = Sign>>(iter: I) -> Self
pub fn fold<I: IntoIterator<Item = Sign>>(iter: I) -> Self
Combines all signs in iter with zero-dominance.
Sourcepub const fn fold_slice(slice: &[Sign]) -> Self
pub const fn fold_slice(slice: &[Sign]) -> Self
Combines all signs in slice with zero-dominance.
Trait Implementationsยง
impl Copy for Sign
impl Eq for Sign
impl StructuralPartialEq for Sign
Sourceยงimpl TryFrom<Sign> for u8
impl TryFrom<Sign> for u8
Sourceยงimpl TryFrom<Sign> for u16
impl TryFrom<Sign> for u16
Sourceยงimpl TryFrom<Sign> for u32
impl TryFrom<Sign> for u32
Sourceยงimpl TryFrom<Sign> for u64
impl TryFrom<Sign> for u64
Sourceยงimpl TryFrom<Sign> for u128
impl TryFrom<Sign> for u128
Auto Trait Implementationsยง
impl Freeze for Sign
impl RefUnwindSafe for Sign
impl Send for Sign
impl Sync for Sign
impl Unpin for Sign
impl UnsafeUnpin for Sign
impl UnwindSafe for Sign
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
Sourceยงimpl<T> ByteSized for T
impl<T> ByteSized for T
Sourceยงconst BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
The alignment of this type in bytes.
Sourceยงfn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Returns the alignment of this type in bytes.