Struct distances::number::Bool

source ·
pub struct Bool(/* private fields */);
Expand description

A Number that can be used as a boolean.

Implementations§

source§

impl Bool

source

pub const fn from_bool(b: bool) -> Self

Creates a new NumBool from a bool.

source

pub const fn as_bool(&self) -> bool

Returns the NumBool as a bool.

Trait Implementations§

source§

impl Add for Bool

§

type Output = Bool

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl AddAssign for Bool

source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
source§

impl Clone for Bool

source§

fn clone(&self) -> Bool

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 Bool

source§

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

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

impl Default for Bool

source§

fn default() -> Bool

Returns the “default value” for a type. Read more
source§

impl Display for Bool

source§

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

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

impl Div for Bool

§

type Output = Bool

The resulting type after applying the / operator.
source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
source§

impl DivAssign for Bool

source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
source§

impl Hash for Bool

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 for Bool

§

type Output = Bool

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl MulAssign for Bool

source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
source§

impl Number for Bool

source§

fn zero() -> Self

Returns the additive identity.
source§

fn one() -> Self

Returns the multiplicative identity.
source§

fn mul_add(self, a: Self, b: Self) -> Self

Returns self + a * b.
source§

fn mul_add_assign(&mut self, a: Self, b: Self)

Replaces self with self + a * b.
source§

fn from<T: Number>(n: T) -> Self

Casts a number to Self. This may be a lossy conversion.
source§

fn as_f32(self) -> f32

Returns the number as a f32. This may be a lossy conversion.
source§

fn as_f64(self) -> f64

Returns the number as a f64. This may be a lossy conversion.
source§

fn as_u64(self) -> u64

Returns the number as a u64. This may be a lossy conversion.
source§

fn as_i64(self) -> i64

Returns the number as a i64. This may be a lossy conversion.
source§

fn abs(self) -> Self

Returns the absolute value of a Number.
source§

fn abs_diff(self, other: Self) -> Self

Returns the absolute difference between two Numbers.
source§

fn powi(self, exp: i32) -> Self

Returns self raised to the power of exp.
source§

fn num_bytes() -> usize

Returns the number of bytes used to represent a Number.
source§

fn from_le_bytes(bytes: &[u8]) -> Self

Reads a Number from little endian bytes.
source§

fn to_le_bytes(self) -> Vec<u8>

Converts a Number to little endian bytes.
source§

fn from_be_bytes(bytes: &[u8]) -> Self

Reads a Number from big endian bytes.
source§

fn to_be_bytes(self) -> Vec<u8>

Converts a Number to big endian bytes.
source§

fn epsilon() -> Self

Returns the epsilon value for the type. Read more
source§

fn next_random<R: Rng>(rng: &mut R) -> Self

Returns a random Number.
source§

fn type_name<'a>() -> &'a str

Returns the name of the type.
source§

impl Ord for Bool

source§

fn cmp(&self, other: &Bool) -> 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 Bool

source§

fn eq(&self, other: &Bool) -> 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 Bool

source§

fn partial_cmp(&self, other: &Bool) -> 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 Rem for Bool

§

type Output = Bool

The resulting type after applying the % operator.
source§

fn rem(self, rhs: Self) -> Self::Output

Performs the % operation. Read more
source§

impl RemAssign for Bool

source§

fn rem_assign(&mut self, rhs: Self)

Performs the %= operation. Read more
source§

impl Sub for Bool

§

type Output = Bool

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
source§

impl SubAssign for Bool

source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
source§

impl Sum for Bool

source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl Copy for Bool

source§

impl Eq for Bool

source§

impl StructuralPartialEq for Bool

Auto Trait Implementations§

§

impl Freeze for Bool

§

impl RefUnwindSafe for Bool

§

impl Send for Bool

§

impl Sync for Bool

§

impl Unpin for Bool

§

impl UnwindSafe for Bool

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V