Enum number_general::UInt

source ·
pub enum UInt {
    U8(u8),
    U16(u16),
    U32(u32),
    U64(u64),
}
Expand description

An unsigned integer.

Variants§

§

U8(u8)

§

U16(u16)

§

U32(u32)

§

U64(u64)

Trait Implementations§

source§

impl Add for UInt

§

type Output = UInt

The resulting type after applying the + operator.
source§

fn add(self, other: UInt) -> Self

Performs the + operation. Read more
source§

impl AddAssign for UInt

source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
source§

impl CastFrom<Complex> for UInt

source§

fn cast_from(c: Complex) -> UInt

Cast an instance of T into an instance of Self.
source§

impl CastFrom<Float> for UInt

source§

fn cast_from(f: Float) -> UInt

Cast an instance of T into an instance of Self.
source§

impl CastFrom<Int> for UInt

source§

fn cast_from(i: Int) -> UInt

Cast an instance of T into an instance of Self.
source§

impl CastFrom<Number> for UInt

source§

fn cast_from(number: Number) -> UInt

Cast an instance of T into an instance of Self.
source§

impl CastFrom<UInt> for bool

source§

fn cast_from(u: UInt) -> bool

Cast an instance of T into an instance of Self.
source§

impl CastFrom<UInt> for u16

source§

fn cast_from(u: UInt) -> u16

Cast an instance of T into an instance of Self.
source§

impl CastFrom<UInt> for u32

source§

fn cast_from(u: UInt) -> u32

Cast an instance of T into an instance of Self.
source§

impl CastFrom<UInt> for u8

source§

fn cast_from(u: UInt) -> u8

Cast an instance of T into an instance of Self.
source§

impl Clone for UInt

source§

fn clone(&self) -> UInt

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 UInt

source§

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

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

impl Default for UInt

source§

fn default() -> UInt

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

impl Display for UInt

source§

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

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

impl Div for UInt

§

type Output = UInt

The resulting type after applying the / operator.
source§

fn div(self, other: UInt) -> Self

Performs the / operation. Read more
source§

impl DivAssign for UInt

source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
source§

impl From<Boolean> for UInt

source§

fn from(b: Boolean) -> UInt

Converts to this type from the input type.
source§

impl From<UInt> for Complex

source§

fn from(u: UInt) -> Self

Converts to this type from the input type.
source§

impl From<UInt> for Float

source§

fn from(u: UInt) -> Self

Converts to this type from the input type.
source§

impl From<UInt> for Int

source§

fn from(u: UInt) -> Int

Converts to this type from the input type.
source§

impl From<UInt> for Number

source§

fn from(u: UInt) -> Number

Converts to this type from the input type.
source§

impl From<UInt> for u64

source§

fn from(u: UInt) -> u64

Converts to this type from the input type.
source§

impl From<UInt> for usize

source§

fn from(u: UInt) -> usize

Converts to this type from the input type.
source§

impl From<u16> for UInt

source§

fn from(u: u16) -> UInt

Converts to this type from the input type.
source§

impl From<u32> for UInt

source§

fn from(u: u32) -> UInt

Converts to this type from the input type.
source§

impl From<u64> for UInt

source§

fn from(u: u64) -> UInt

Converts to this type from the input type.
source§

impl From<u8> for UInt

source§

fn from(u: u8) -> UInt

Converts to this type from the input type.
source§

impl FromStr for UInt

§

type Err = Error

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl GetSize for UInt

source§

fn get_heap_size(&self) -> usize

Determines how many bytes this object occupies inside the heap. Read more
source§

fn get_stack_size() -> usize

Determines how may bytes this object occupies inside the stack. Read more
source§

fn get_size(&self) -> usize

Determines the total size of the object. Read more
source§

impl Hash for UInt

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 UInt

§

type Output = UInt

The resulting type after applying the * operator.
source§

fn mul(self, other: UInt) -> Self

Performs the * operation. Read more
source§

impl MulAssign for UInt

source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
source§

impl NumberInstance for UInt

§

type Abs = UInt

§

type Exp = Float

§

type Log = Float

§

type Round = UInt

§

type Class = UIntType

source§

fn class(&self) -> UIntType

Get an impl of NumberClass describing this number.
source§

fn into_type(self, dtype: UIntType) -> UInt

Cast this number into the specified NumberClass.
source§

fn abs(self) -> UInt

Calculate the absolute value of this number.
source§

fn exp(self) -> Self::Exp

Raise e to the power of this number.
source§

fn ln(self) -> Self::Log

Compute the natural logarithm of this number.
source§

fn log<N: NumberInstance>(self, base: N) -> Self::Log
where Float: From<N>,

Compute the logarithm of this number with respect to the given base.
source§

fn pow(self, exp: Number) -> Self

Raise this number to the given exponent. Read more
source§

fn round(self) -> Self::Round

Return this number rounded to the nearest integer.
source§

impl Ord for UInt

source§

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

source§

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

source§

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

source§

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

Method which takes an iterator and generates Self from the elements by multiplying the items.
source§

impl RealInstance for UInt

source§

const ONE: Self = _

source§

const ZERO: Self = _

source§

fn is_positive(&self) -> bool

Return true if this is zero or a positive number.
source§

fn is_negative(&self) -> bool

Return true if this is a negative number.
source§

fn is_zero(&self) -> bool

Return true if this is zero.
source§

impl Rem for UInt

§

type Output = UInt

The resulting type after applying the % operator.
source§

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

Performs the % operation. Read more
source§

impl Sub for UInt

§

type Output = UInt

The resulting type after applying the - operator.
source§

fn sub(self, other: UInt) -> Self

Performs the - operation. Read more
source§

impl SubAssign for UInt

source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
source§

impl Sum for UInt

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 Trigonometry for UInt

§

type Out = Float

source§

fn asin(self) -> Self::Out

Arcsine
source§

fn sin(self) -> Self::Out

Sine
source§

fn sinh(self) -> Self::Out

Hyperbolic sine
source§

fn asinh(self) -> Self::Out

Hyperbolic arcsine
source§

fn acos(self) -> Self::Out

Hyperbolic arccosine
source§

fn cos(self) -> Self::Out

Cosine
source§

fn cosh(self) -> Self::Out

Hyperbolic cosine
source§

fn acosh(self) -> Self::Out

Hyperbolic arccosine
source§

fn atan(self) -> Self::Out

Arctangent
source§

fn tan(self) -> Self::Out

Tangent
source§

fn tanh(self) -> Self::Out

Hyperbolic tangent
source§

fn atanh(self) -> Self::Out

Hyperbolic arctangent
source§

impl Copy for UInt

source§

impl Eq for UInt

Auto Trait Implementations§

§

impl RefUnwindSafe for UInt

§

impl Send for UInt

§

impl Sync for UInt

§

impl Unpin for UInt

§

impl UnwindSafe for UInt

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<F, T> CastFrom<F> for T
where T: From<F>,

source§

fn cast_from(f: F) -> T

Cast an instance of T into an instance of Self.
source§

impl<T, F> CastInto<F> for T
where F: CastFrom<T>,

source§

fn cast_into(self) -> F

Cast an instance of Self into an instance of T.
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<F> Match for F

source§

fn matches<T>(&self) -> bool
where T: TryCastFrom<Self>,

Returns true if self can be cast into the target type T.
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<F, T> TryCastFrom<F> for T
where T: CastFrom<F>,

source§

fn can_cast_from(_: &F) -> bool

Test if value can be cast into Self.
source§

fn opt_cast_from(f: F) -> Option<T>

Returns Some(Self) if the source value can be cast into Self, otherwise None.
source§

fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err>
where OnErr: FnOnce(&T) -> Err,

Returns Ok(Self) if the source value can be cast into Self, otherwise calls on_err.
source§

impl<F, T> TryCastInto<T> for F
where T: TryCastFrom<F>,

source§

fn can_cast_into(&self) -> bool

Test if self can be cast into T.
source§

fn opt_cast_into(self) -> Option<T>

Returns Some(T) if self can be cast into T, otherwise None.
source§

fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>
where OnErr: FnOnce(&Self) -> Err,

Returns Ok(T) if self can be cast into T, otherwise calls on_err.
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<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,