Enum dashu_base::sign::Sign

source ·
pub enum Sign {
    Positive,
    Negative,
}
Expand description

An enum representing the sign of a number

A sign can be converted to or from a boolean value, assuming true is Negative.

Variants§

§

Positive

§

Negative

Trait Implementations§

source§

impl Clone for Sign

source§

fn clone(&self) -> Sign

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Sign

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Sign> for bool

source§

fn from(v: Sign) -> Self

Convert Sign to boolean value, returns true for Negative

source§

impl From<bool> for Sign

source§

fn from(v: bool) -> Self

Convert boolean value to Sign, returns Negative for true

source§

impl Hash for Sign

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Mul<Ordering> for Sign

§

type Output = Ordering

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Ordering) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Sign> for Ordering

§

type Output = Ordering

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Sign) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Sign> for f32

§

type Output = f32

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Sign) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Sign> for f64

§

type Output = f64

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Sign) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Sign> for i128

§

type Output = i128

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Sign) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Sign> for i16

§

type Output = i16

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Sign) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Sign> for i32

§

type Output = i32

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Sign) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Sign> for i64

§

type Output = i64

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Sign) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Sign> for i8

§

type Output = i8

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Sign) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<Sign> for isize

§

type Output = isize

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Sign) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<f32> for Sign

§

type Output = f32

The resulting type after applying the * operator.
source§

fn mul(self, rhs: f32) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<f64> for Sign

§

type Output = f64

The resulting type after applying the * operator.
source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<i128> for Sign

§

type Output = i128

The resulting type after applying the * operator.
source§

fn mul(self, rhs: i128) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<i16> for Sign

§

type Output = i16

The resulting type after applying the * operator.
source§

fn mul(self, rhs: i16) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<i32> for Sign

§

type Output = i32

The resulting type after applying the * operator.
source§

fn mul(self, rhs: i32) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<i64> for Sign

§

type Output = i64

The resulting type after applying the * operator.
source§

fn mul(self, rhs: i64) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<i8> for Sign

§

type Output = i8

The resulting type after applying the * operator.
source§

fn mul(self, rhs: i8) -> Self::Output

Performs the * operation. Read more
source§

impl Mul<isize> for Sign

§

type Output = isize

The resulting type after applying the * operator.
source§

fn mul(self, rhs: isize) -> Self::Output

Performs the * operation. Read more
source§

impl Mul for Sign

§

type Output = Sign

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Sign) -> Sign

Performs the * operation. Read more
source§

impl MulAssign for Sign

source§

fn mul_assign(&mut self, rhs: Sign)

Performs the *= operation. Read more
source§

impl Neg for Sign

§

type Output = Sign

The resulting type after applying the - operator.
source§

fn neg(self) -> Sign

Performs the unary - operation. Read more
source§

impl Ord for Sign

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Sign

source§

fn eq(&self, other: &Sign) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Sign

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for Sign

source§

impl Eq for Sign

source§

impl StructuralPartialEq for Sign

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.