Number

Trait Number 

Source
pub trait Number:
    Bound
    + Count
    + Ident
    + Sign {
    type InnerRepr;
    type InnermostRepr;

    // Required methods
    fn from_inner_repr(inner: Self::InnerRepr) -> NumeraResult<Self>
       where Self: Sized;
    unsafe fn from_inner_repr_unchecked(inner: Self::InnerRepr) -> Self;
    fn from_innermost_repr(innermost: Self::InnermostRepr) -> NumeraResult<Self>
       where Self: Sized;
    unsafe fn from_innermost_repr_unchecked(
        innermost: Self::InnermostRepr,
    ) -> Self;
    fn into_inner_repr(self) -> Self::InnerRepr;
    fn into_innermost_repr(self) -> Self::InnermostRepr;

    // Provided method
    fn try_from_inner_repr(
        inner: impl Into<Self::InnerRepr>,
    ) -> NumeraResult<Self>
       where Self: Sized { ... }
}
Expand description

Common trait for all numbers.

Required Associated Types§

Source

type InnerRepr

The inner primitive representation of the number.

May be the same as InnermostRepr.

For example a NonNegativeInteger8 would have InnerRepr = NonZeroU8, and InnermostRepr = u8, while an Integer8 and an i8 would both have an i8 in both cases.

Source

type InnermostRepr

The innermost primitive representation of the number.

May be the same as InnerRepr.

For example a NonNegativeInteger8 would have InnerRepr = NonZeroU8, and InnermostRepr = u8, while an Integer8 and an i8 would both have an i8 in both cases.

Required Methods§

Source

fn from_inner_repr(inner: Self::InnerRepr) -> NumeraResult<Self>
where Self: Sized,

Forms a new number from its given inner representation.

§Errors

Returns an error if inner does not conform to the invariants of what’s considered a valid state for this type of number.

For example a NonNegativeInteger8 would have InnerRepr = NonZeroU8, and InnermostRepr = u8, while an Integer8 would have i8 in both cases.

Source

unsafe fn from_inner_repr_unchecked(inner: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.

Forms a new number from its given inner representation.

§Panics

Could panic (specially in debug) if inner does not conform to the invariants of what’s considered a valid state for this number.

§Safety

The invariants inherent to the specific number type must be maintained.

Source

fn from_innermost_repr(innermost: Self::InnermostRepr) -> NumeraResult<Self>
where Self: Sized,

Forms a new number from its innermost representation.

§Errors

Returns an error if innermost does not conform to the invariants of what’s considered a valid state for this type of number.

For example a NonNegativeInteger8 would have InnerRepr = NonZeroU8, and InnermostRepr = u8, while an Integer8 would have i8 in both cases.

Source

unsafe fn from_innermost_repr_unchecked(innermost: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.

Forms a new number from its innermost representation.

§Panics

Could panic (specially in debug) if innermost does not conform to the invariants of what’s considered a valid state for this number.

§Safety

The invariants inherent to the specific number type must be maintained.

Source

fn into_inner_repr(self) -> Self::InnerRepr

Deconstructs the number to its inner representation.

Source

fn into_innermost_repr(self) -> Self::InnermostRepr

Deconstructs the number to its innermost representation.

Provided Methods§

Source

fn try_from_inner_repr(inner: impl Into<Self::InnerRepr>) -> NumeraResult<Self>
where Self: Sized,

Forms a new number from its converted given inner representation.

§Errors

Returns an error if the converted inner does not conform to the invariants of what’s considered a valid state for this number.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Number for f32

Source§

type InnerRepr = f32

Source§

type InnermostRepr = f32

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for f64

Source§

type InnerRepr = f64

Source§

type InnermostRepr = f64

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for i8

Source§

type InnerRepr = i8

Source§

type InnermostRepr = i8

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for i16

Source§

type InnerRepr = i16

Source§

type InnermostRepr = i16

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for i32

Source§

type InnerRepr = i32

Source§

type InnermostRepr = i32

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for i64

Source§

type InnerRepr = i64

Source§

type InnermostRepr = i64

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for i128

Source§

type InnerRepr = i128

Source§

type InnermostRepr = i128

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for isize

Source§

type InnerRepr = isize

Source§

type InnermostRepr = isize

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for u8

Source§

type InnerRepr = u8

Source§

type InnermostRepr = u8

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for u16

Source§

type InnerRepr = u16

Source§

type InnermostRepr = u16

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for u32

Source§

type InnerRepr = u32

Source§

type InnermostRepr = u32

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for u64

Source§

type InnerRepr = u64

Source§

type InnermostRepr = u64

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for u128

Source§

type InnerRepr = u128

Source§

type InnermostRepr = u128

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for usize

Source§

type InnerRepr = usize

Source§

type InnermostRepr = usize

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for IBig

Source§

type InnerRepr = IBig

Source§

type InnermostRepr = IBig

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for UBig

Source§

type InnerRepr = UBig

Source§

type InnermostRepr = UBig

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for bf16

Source§

type InnerRepr = bf16

Source§

type InnermostRepr = bf16

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for f16

Source§

type InnerRepr = f16

Source§

type InnermostRepr = f16

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for TwoFloat

Source§

type InnerRepr = TwoFloat

Source§

type InnermostRepr = TwoFloat

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for NonZeroI8

Source§

type InnerRepr = i8

Source§

type InnermostRepr = i8

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for NonZeroI16

Source§

type InnerRepr = i16

Source§

type InnermostRepr = i16

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for NonZeroI32

Source§

type InnerRepr = i32

Source§

type InnermostRepr = i32

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for NonZeroI64

Source§

type InnerRepr = i64

Source§

type InnermostRepr = i64

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for NonZeroI128

Source§

type InnerRepr = i128

Source§

type InnermostRepr = i128

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for NonZeroIsize

Source§

type InnerRepr = isize

Source§

type InnermostRepr = isize

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for NonZeroU8

Source§

type InnerRepr = u8

Source§

type InnermostRepr = u8

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for NonZeroU16

Source§

type InnerRepr = u16

Source§

type InnermostRepr = u16

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for NonZeroU32

Source§

type InnerRepr = u32

Source§

type InnermostRepr = u32

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for NonZeroU64

Source§

type InnerRepr = u64

Source§

type InnermostRepr = u64

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for NonZeroU128

Source§

type InnerRepr = u128

Source§

type InnermostRepr = u128

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Source§

impl Number for NonZeroUsize

Source§

type InnerRepr = usize

Source§

type InnermostRepr = usize

Source§

fn from_inner_repr(value: Self::InnerRepr) -> NumeraResult<Self>

Source§

unsafe fn from_inner_repr_unchecked(value: Self::InnerRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn from_innermost_repr(value: Self::InnermostRepr) -> NumeraResult<Self>

Source§

unsafe fn from_innermost_repr_unchecked(value: Self::InnermostRepr) -> Self

Available on crate feature not(safe) only.
Source§

fn into_inner_repr(self) -> Self::InnerRepr

Source§

fn into_innermost_repr(self) -> Self::InnermostRepr

Implementors§

Source§

impl Number for NegativeIntegers

This implementation is no-op.

Source§

impl Number for NonNegativeIntegers

This implementation is no-op.

Source§

impl Number for NonPositiveIntegers

This implementation is no-op.

Source§

impl Number for NonZeroIntegers

This implementation is no-op.

Source§

impl Number for PositiveIntegers

This implementation is no-op.

Source§

impl Number for AllIntegers

This implementation is no-op.

Source§

impl Number for AllRationals

This implementation is no-op.

Source§

impl Number for Integers

This implementation is no-op.

Source§

impl Number for Primes

This implementation is no-op.

Source§

impl Number for Rationals

This implementation is no-op.

Source§

impl Number for BrainFloat16

Source§

impl Number for DecFloat32

Available on crate feature decstr only.
Source§

impl Number for DecFloat64

Available on crate feature decstr only.
Source§

impl Number for DecFloat128

Available on crate feature decstr only.
Source§

impl Number for Float16

Source§

impl Number for Float32

Source§

impl Number for Float64

Source§

impl Number for Integer8

Source§

impl Number for Integer16

Source§

impl Number for Integer128

Source§

impl Number for IntegerBig

Available on crate feature dashu-int only.
Source§

impl Number for NegativeInteger8

Source§

impl Number for NegativeInteger16

Source§

impl Number for NegativeInteger32

Source§

impl Number for NegativeInteger64

Source§

impl Number for NegativeInteger128

Source§

impl Number for NonNegativeInteger8

Source§

impl Number for NonNegativeInteger16

Source§

impl Number for NonNegativeInteger32

Source§

impl Number for NonNegativeInteger64

Source§

impl Number for NonNegativeInteger128

Source§

impl Number for NonPositiveInteger8

Source§

impl Number for NonPositiveInteger16

Source§

impl Number for NonPositiveInteger32

Source§

impl Number for NonPositiveInteger64

Source§

impl Number for NonPositiveInteger128

Source§

impl Number for NonZeroInteger8

Source§

impl Number for NonZeroInteger16

Source§

impl Number for NonZeroInteger32

Source§

impl Number for NonZeroInteger64

Source§

impl Number for NonZeroInteger128

Source§

impl Number for PositiveInteger8

Source§

impl Number for PositiveInteger16

Source§

impl Number for PositiveInteger32

Source§

impl Number for PositiveInteger64

Source§

impl Number for PositiveInteger128

Source§

impl Number for Prime8

Source§

impl Number for Prime64

Source§

impl Number for Prime128

Source§

impl Number for Rational8

Source§

impl Number for Rational16

Source§

impl Number for Rational128

Source§

impl Number for TwoFloat128

Source§

impl Number for Integer32

Source§

impl Number for Integer64

Source§

impl Number for Prime16

Source§

impl Number for Prime32

Source§

impl Number for Rational32

Source§

impl Number for Rational64

Source§

impl Number for NoNumber

Source§

impl<N: Number> Number for AllNumbers<N>

This implementation is no-op.