Struct I48

Source
pub struct I48(/* private fields */);
Expand description

48-bit signed integer with alignment of 1.

Implementations§

Source§

impl I48

Source

pub const MIN: Self

The smallest value that can be represented by this integer type.

Source

pub const MAX: Self

The largest value that can be represented by this integer type.

Source§

impl I48

Source

pub const BITS: u32 = 48u32

The amount of bits required by this integer type.

Source§

impl I48

Source

pub const fn to_ne_bytes(self) -> [u8; 6]

Returns the integer value as a byte array in native-endian order.

Source

pub fn to_le_bytes(self) -> [u8; 6]

Returns the integer value as a byte array in little-endian order.

Source

pub fn to_be_bytes(self) -> [u8; 6]

Returns the integer value as a byte array in big-endian order.

Source

pub const fn from_ne_bytes(bytes: [u8; 6]) -> Self

Creates an unaligned signed integer from the given bytes in native-endian order.

Source

pub fn from_le_bytes(bytes: [u8; 6]) -> Self

Creates an unaligned signed integer from the given bytes in little-endian order.

Source

pub fn from_be_bytes(bytes: [u8; 6]) -> Self

Creates an unaligned signed integer from the given bytes in big-endian order.

Trait Implementations§

Source§

impl Binary for I48

Source§

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

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

impl Clone for I48

Source§

fn clone(&self) -> I48

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for I48

Source§

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

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

impl Default for I48

Source§

fn default() -> Self

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

impl Display for I48

Source§

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

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

impl From<I16> for I48

Source§

fn from(value: I16) -> Self

Converts to this type from the input type.
Source§

impl From<I32> for I48

Source§

fn from(value: I32) -> Self

Converts to this type from the input type.
Source§

impl From<I40> for I48

Source§

fn from(value: I40) -> Self

Converts to this type from the input type.
Source§

impl From<I48> for I104

Source§

fn from(value: I48) -> Self

Converts to this type from the input type.
Source§

impl From<I48> for I112

Source§

fn from(value: I48) -> Self

Converts to this type from the input type.
Source§

impl From<I48> for I120

Source§

fn from(value: I48) -> Self

Converts to this type from the input type.
Source§

impl From<I48> for I56

Source§

fn from(value: I48) -> Self

Converts to this type from the input type.
Source§

impl From<I48> for I72

Source§

fn from(value: I48) -> Self

Converts to this type from the input type.
Source§

impl From<I48> for I80

Source§

fn from(value: I48) -> Self

Converts to this type from the input type.
Source§

impl From<I48> for I88

Source§

fn from(value: I48) -> Self

Converts to this type from the input type.
Source§

impl From<I48> for I96

Source§

fn from(value: I48) -> Self

Converts to this type from the input type.
Source§

impl From<I48> for i128

Source§

fn from(value: I48) -> Self

Converts to this type from the input type.
Source§

impl From<I48> for i64

Source§

fn from(value: I48) -> Self

Converts to this type from the input type.
Source§

impl From<U16> for I48

Source§

fn from(value: U16) -> Self

Converts to this type from the input type.
Source§

impl From<U24> for I48

Source§

fn from(value: U24) -> Self

Converts to this type from the input type.
Source§

impl From<U32> for I48

Source§

fn from(value: U32) -> Self

Converts to this type from the input type.
Source§

impl From<U40> for I48

Source§

fn from(value: U40) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for I48

Source§

fn from(value: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for I48

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for I48

Source§

fn from(value: i8) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for I48

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for I48

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for I48

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl Hash for I48

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 LowerExp for I48

Source§

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

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

impl LowerHex for I48

Source§

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

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

impl Octal for I48

Source§

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

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

impl Ord for I48

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,

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

impl PartialEq for I48

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for I48

Source§

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

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

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

Tests less than (for self and other) and is used by the < operator. Read more
Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl TryFrom<I104> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: I104) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I112> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: I112) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I120> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: I120) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I128> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: I128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for I16

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for I24

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for I32

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for I40

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U104

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U112

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U120

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U128

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U16

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U24

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U32

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U40

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U48

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U56

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U64

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U72

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U80

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U88

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for U96

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for i16

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for i32

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for u128

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for u16

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for u32

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I48> for u64

Source§

type Error = TryFromIntError

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

fn try_from(value: I48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I56> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: I56) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I64> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: I64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I72> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: I72) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I80> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: I80) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I88> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: I88) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<I96> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: I96) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<U104> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: U104) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<U112> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: U112) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<U120> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: U120) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<U128> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: U128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<U48> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: U48) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<U56> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: U56) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<U64> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: U64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<U72> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: U72) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<U80> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: U80) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<U88> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: U88) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<U96> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: U96) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i128> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: i128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i64> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: i64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u128> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: u128) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<u64> for I48

Source§

type Error = TryFromIntError

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

fn try_from(value: u64) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl UpperExp for I48

Source§

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

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

impl UpperHex for I48

Source§

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

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

impl Copy for I48

Source§

impl Eq for I48

Source§

impl StructuralPartialEq for I48

Auto Trait Implementations§

§

impl Freeze for I48

§

impl RefUnwindSafe for I48

§

impl Send for I48

§

impl Sync for I48

§

impl Unpin for I48

§

impl UnwindSafe for I48

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.