[][src]Trait funty::IsNumber

pub trait IsNumber: Sized + Send + Sync + Unpin + Clone + Copy + Default + FromStr + PartialEq<Self> + PartialOrd<Self> + Debug + Display + Product<Self> + for<'a> Product<&'a Self> + Sum<Self> + for<'a> Sum<&'a Self> + Add<Self, Output = Self> + for<'a> Add<&'a Self, Output = Self> + AddAssign<Self> + for<'a> AddAssign<&'a Self> + Sub<Self, Output = Self> + for<'a> Sub<&'a Self, Output = Self> + SubAssign<Self> + for<'a> SubAssign<&'a Self> + Mul<Self, Output = Self> + for<'a> Mul<&'a Self, Output = Self> + MulAssign<Self> + for<'a> MulAssign<&'a Self> + Div<Self, Output = Self> + for<'a> Div<&'a Self, Output = Self> + DivAssign<Self> + for<'a> DivAssign<&'a Self> + Rem<Self, Output = Self> + for<'a> Rem<&'a Self, Output = Self> + RemAssign<Self> + for<'a> RemAssign<&'a Self> {
    type Bytes;
    fn to_be_bytes(self) -> Self::Bytes;
fn to_le_bytes(self) -> Self::Bytes;
fn to_ne_bytes(self) -> Self::Bytes;
fn from_be_bytes(bytes: Self::Bytes) -> Self;
fn from_le_bytes(bytes: Self::Bytes) -> Self;
fn from_ne_bytes(bytes: Self::Bytes) -> Self; }

Declare that a type is an abstract number.

This unifies all of the signed-integer, unsigned-integer, and floating-point types.

Associated Types

type Bytes

Loading content...

Required methods

fn to_be_bytes(self) -> Self::Bytes

Return the memory representation of this number as a byte array in big-endian (network) byte order.

fn to_le_bytes(self) -> Self::Bytes

Return the memory representation of this number as a byte array in little-endian byte order.

fn to_ne_bytes(self) -> Self::Bytes

Return the memory representation of this number as a byte array in native byte order.

fn from_be_bytes(bytes: Self::Bytes) -> Self

Create a numeric value from its representation as a byte array in big endian.

fn from_le_bytes(bytes: Self::Bytes) -> Self

Create a numeric value from its representation as a byte array in little endian.

fn from_ne_bytes(bytes: Self::Bytes) -> Self

Create a numeric value from its memory representation as a byte array in native endianness.

Loading content...

Implementations on Foreign Types

impl IsNumber for i8[src]

type Bytes = [u8; 1]

impl IsNumber for i16[src]

type Bytes = [u8; 2]

impl IsNumber for i32[src]

type Bytes = [u8; 4]

impl IsNumber for i64[src]

type Bytes = [u8; 8]

impl IsNumber for i128[src]

type Bytes = [u8; 16]

impl IsNumber for isize[src]

type Bytes = [u8; 8]

impl IsNumber for u8[src]

type Bytes = [u8; 1]

impl IsNumber for u16[src]

type Bytes = [u8; 2]

impl IsNumber for u32[src]

type Bytes = [u8; 4]

impl IsNumber for u64[src]

type Bytes = [u8; 8]

impl IsNumber for u128[src]

type Bytes = [u8; 16]

impl IsNumber for usize[src]

type Bytes = [u8; 8]

impl IsNumber for f32[src]

type Bytes = [u8; 4]

impl IsNumber for f64[src]

type Bytes = [u8; 8]

Loading content...

Implementors

Loading content...