i56

Struct i56 

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

The 56-bit signed integer type.

Implementations§

Source§

impl i56

The 56-bit signed integer type.

Source

pub const MAX: i56

Source

pub const MIN: i56

Source

pub const BITS: u32 = 56u32

Source§

impl i56

Source

pub fn min_value() -> i56

Returns the smallest value that can be represented by this integer type.

Source

pub fn max_value() -> i56

Returns the largest value that can be represented by this integer type.

Source

pub const fn new(value: i64) -> i56

Crates a new variable

This function mainly exists as there is currently not a better way to construct these types. May be deprecated or removed if a better way to construct these types becomes available.

§Examples

Basic usage:

use ux::*;

assert_eq!(u31::new(64), u31::from(64u8));
§Panic

This function will panic if value is not representable by this type

Source

pub fn wrapping_sub(self, rhs: i56) -> i56

Wrapping (modular) subtraction. Computes self - other, wrapping around at the boundary of the type.

§Examples

Basic usage:

use ux::*;

assert_eq!(i5::MIN.wrapping_sub(i5::new(1)), i5::MAX);

assert_eq!(i5::new(-10).wrapping_sub(i5::new(5)), i5::new(-15));
assert_eq!(i5::new(-15).wrapping_sub(i5::new(5)), i5::new(12));
Source

pub fn wrapping_add(self, rhs: i56) -> i56

Wrapping (modular) addition. Computes self + other, wrapping around at the boundary of the type.

§Examples

Basic usage:

use ux::*;

assert_eq!(i5::MAX.wrapping_add(i5::new(1)), i5::MIN);

assert_eq!(i5::new(10).wrapping_add(i5::new(5)), i5::new(15));
assert_eq!(i5::new(15).wrapping_add(i5::new(5)), i5::new(-12));

Trait Implementations§

Source§

impl Add for i56

Source§

type Output = i56

The resulting type after applying the + operator.
Source§

fn add(self, other: i56) -> i56

Performs the + operation. Read more
Source§

impl Binary for i56

Source§

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

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

impl<'a> BitAnd<&'a i56> for i56

Source§

type Output = <i56 as BitOr>::Output

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &'a i56) -> <i56 as BitAnd<&'a i56>>::Output

Performs the & operation. Read more
Source§

impl<'a> BitAnd<i56> for &'a i56

Source§

type Output = <i56 as BitOr>::Output

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: i56) -> <&'a i56 as BitAnd<i56>>::Output

Performs the & operation. Read more
Source§

impl<'a> BitAnd for &'a i56

Source§

type Output = <i56 as BitOr>::Output

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &'a i56) -> <&'a i56 as BitAnd>::Output

Performs the & operation. Read more
Source§

impl BitAnd for i56

Source§

type Output = i56

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: i56) -> <i56 as BitAnd>::Output

Performs the & operation. Read more
Source§

impl BitAndAssign for i56

Source§

fn bitand_assign(&mut self, other: i56)

Performs the &= operation. Read more
Source§

impl<'a> BitOr<&'a i56> for i56

Source§

type Output = <i56 as BitOr>::Output

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &'a i56) -> <i56 as BitOr<&'a i56>>::Output

Performs the | operation. Read more
Source§

impl<'a> BitOr<i56> for &'a i56

Source§

type Output = <i56 as BitOr>::Output

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: i56) -> <&'a i56 as BitOr<i56>>::Output

Performs the | operation. Read more
Source§

impl<'a> BitOr for &'a i56

Source§

type Output = <i56 as BitOr>::Output

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &'a i56) -> <&'a i56 as BitOr>::Output

Performs the | operation. Read more
Source§

impl BitOr for i56

Source§

type Output = i56

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: i56) -> <i56 as BitOr>::Output

Performs the | operation. Read more
Source§

impl BitOrAssign for i56

Source§

fn bitor_assign(&mut self, other: i56)

Performs the |= operation. Read more
Source§

impl<'a> BitXor<&'a i56> for i56

Source§

type Output = <i56 as BitOr>::Output

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &'a i56) -> <i56 as BitXor<&'a i56>>::Output

Performs the ^ operation. Read more
Source§

impl<'a> BitXor<i56> for &'a i56

Source§

type Output = <i56 as BitOr>::Output

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: i56) -> <&'a i56 as BitXor<i56>>::Output

Performs the ^ operation. Read more
Source§

impl<'a> BitXor for &'a i56

Source§

type Output = <i56 as BitOr>::Output

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &'a i56) -> <&'a i56 as BitXor>::Output

Performs the ^ operation. Read more
Source§

impl BitXor for i56

Source§

type Output = i56

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: i56) -> <i56 as BitXor>::Output

Performs the ^ operation. Read more
Source§

impl BitXorAssign for i56

Source§

fn bitxor_assign(&mut self, other: i56)

Performs the ^= operation. Read more
Source§

impl Clone for i56

Source§

fn clone(&self) -> i56

Returns a duplicate 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 i56

Source§

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

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

impl<B: Buf> Decoder<B> for i56

Source§

type Error = Error

The type of error that can occur if decoding fails.
Source§

fn decode(buf: &mut B) -> Result<Self, Self::Error>

Decodes a value from the given buffer. Read more
Source§

impl<B: Buf> Decoder<B, usize> for i56

Source§

type Error = Error

The type of error that can occur if decoding fails.
Source§

fn decode(buf: &mut B) -> Result<usize, Self::Error>

Decodes a value from the given buffer. Read more
Source§

impl Default for i56

Source§

fn default() -> i56

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

impl Display for i56

Source§

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

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

impl<B: BufMut> Encoder<B> for i56

Source§

type Error = Infallible

The type of error that can occur if encoding fails.
Source§

fn encode(item: &i56, buf: &mut B) -> Result<(), Self::Error>

Encodes the given input into the output buffer. Read more
Source§

fn size_of(_: &i56, _: &B) -> usize

Returns the number of bytes required to encode the given input. Read more
Source§

impl<B: BufMut> Encoder<B, usize> for i56

Source§

type Error = Error

The type of error that can occur if encoding fails.
Source§

fn encode(item: &usize, buf: &mut B) -> Result<(), Self::Error>

Encodes the given input into the output buffer. Read more
Source§

fn size_of(_: &usize, _: &B) -> usize

Returns the number of bytes required to encode the given input. Read more
Source§

impl From<i10> for i56

Source§

fn from(x: i10) -> i56

Converts to this type from the input type.
Source§

impl From<i11> for i56

Source§

fn from(x: i11) -> i56

Converts to this type from the input type.
Source§

impl From<i12> for i56

Source§

fn from(x: i12) -> i56

Converts to this type from the input type.
Source§

impl From<i13> for i56

Source§

fn from(x: i13) -> i56

Converts to this type from the input type.
Source§

impl From<i14> for i56

Source§

fn from(x: i14) -> i56

Converts to this type from the input type.
Source§

impl From<i15> for i56

Source§

fn from(x: i15) -> i56

Converts to this type from the input type.
Source§

impl From<i16> for i56

Source§

fn from(x: i16) -> i56

Converts to this type from the input type.
Source§

impl From<i17> for i56

Source§

fn from(x: i17) -> i56

Converts to this type from the input type.
Source§

impl From<i18> for i56

Source§

fn from(x: i18) -> i56

Converts to this type from the input type.
Source§

impl From<i19> for i56

Source§

fn from(x: i19) -> i56

Converts to this type from the input type.
Source§

impl From<i2> for i56

Source§

fn from(x: i2) -> i56

Converts to this type from the input type.
Source§

impl From<i20> for i56

Source§

fn from(x: i20) -> i56

Converts to this type from the input type.
Source§

impl From<i21> for i56

Source§

fn from(x: i21) -> i56

Converts to this type from the input type.
Source§

impl From<i22> for i56

Source§

fn from(x: i22) -> i56

Converts to this type from the input type.
Source§

impl From<i23> for i56

Source§

fn from(x: i23) -> i56

Converts to this type from the input type.
Source§

impl From<i24> for i56

Source§

fn from(x: i24) -> i56

Converts to this type from the input type.
Source§

impl From<i25> for i56

Source§

fn from(x: i25) -> i56

Converts to this type from the input type.
Source§

impl From<i26> for i56

Source§

fn from(x: i26) -> i56

Converts to this type from the input type.
Source§

impl From<i27> for i56

Source§

fn from(x: i27) -> i56

Converts to this type from the input type.
Source§

impl From<i28> for i56

Source§

fn from(x: i28) -> i56

Converts to this type from the input type.
Source§

impl From<i29> for i56

Source§

fn from(x: i29) -> i56

Converts to this type from the input type.
Source§

impl From<i3> for i56

Source§

fn from(x: i3) -> i56

Converts to this type from the input type.
Source§

impl From<i30> for i56

Source§

fn from(x: i30) -> i56

Converts to this type from the input type.
Source§

impl From<i31> for i56

Source§

fn from(x: i31) -> i56

Converts to this type from the input type.
Source§

impl From<i32> for i56

Source§

fn from(x: i32) -> i56

Converts to this type from the input type.
Source§

impl From<i33> for i56

Source§

fn from(x: i33) -> i56

Converts to this type from the input type.
Source§

impl From<i34> for i56

Source§

fn from(x: i34) -> i56

Converts to this type from the input type.
Source§

impl From<i35> for i56

Source§

fn from(x: i35) -> i56

Converts to this type from the input type.
Source§

impl From<i36> for i56

Source§

fn from(x: i36) -> i56

Converts to this type from the input type.
Source§

impl From<i37> for i56

Source§

fn from(x: i37) -> i56

Converts to this type from the input type.
Source§

impl From<i38> for i56

Source§

fn from(x: i38) -> i56

Converts to this type from the input type.
Source§

impl From<i39> for i56

Source§

fn from(x: i39) -> i56

Converts to this type from the input type.
Source§

impl From<i4> for i56

Source§

fn from(x: i4) -> i56

Converts to this type from the input type.
Source§

impl From<i40> for i56

Source§

fn from(x: i40) -> i56

Converts to this type from the input type.
Source§

impl From<i41> for i56

Source§

fn from(x: i41) -> i56

Converts to this type from the input type.
Source§

impl From<i42> for i56

Source§

fn from(x: i42) -> i56

Converts to this type from the input type.
Source§

impl From<i43> for i56

Source§

fn from(x: i43) -> i56

Converts to this type from the input type.
Source§

impl From<i44> for i56

Source§

fn from(x: i44) -> i56

Converts to this type from the input type.
Source§

impl From<i45> for i56

Source§

fn from(x: i45) -> i56

Converts to this type from the input type.
Source§

impl From<i46> for i56

Source§

fn from(x: i46) -> i56

Converts to this type from the input type.
Source§

impl From<i47> for i56

Source§

fn from(x: i47) -> i56

Converts to this type from the input type.
Source§

impl From<i48> for i56

Source§

fn from(x: i48) -> i56

Converts to this type from the input type.
Source§

impl From<i49> for i56

Source§

fn from(x: i49) -> i56

Converts to this type from the input type.
Source§

impl From<i5> for i56

Source§

fn from(x: i5) -> i56

Converts to this type from the input type.
Source§

impl From<i50> for i56

Source§

fn from(x: i50) -> i56

Converts to this type from the input type.
Source§

impl From<i51> for i56

Source§

fn from(x: i51) -> i56

Converts to this type from the input type.
Source§

impl From<i52> for i56

Source§

fn from(x: i52) -> i56

Converts to this type from the input type.
Source§

impl From<i53> for i56

Source§

fn from(x: i53) -> i56

Converts to this type from the input type.
Source§

impl From<i54> for i56

Source§

fn from(x: i54) -> i56

Converts to this type from the input type.
Source§

impl From<i55> for i56

Source§

fn from(x: i55) -> i56

Converts to this type from the input type.
Source§

impl From<i6> for i56

Source§

fn from(x: i6) -> i56

Converts to this type from the input type.
Source§

impl From<i7> for i56

Source§

fn from(x: i7) -> i56

Converts to this type from the input type.
Source§

impl From<i8> for i56

Source§

fn from(x: i8) -> i56

Converts to this type from the input type.
Source§

impl From<i9> for i56

Source§

fn from(x: i9) -> i56

Converts to this type from the input type.
Source§

impl Hash for i56

Source§

fn hash<H>(&self, h: &mut H)
where H: Hasher,

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 LowerHex for i56

Source§

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

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

impl<'a> Not for &'a i56

Source§

type Output = <i56 as Not>::Output

The resulting type after applying the ! operator.
Source§

fn not(self) -> i56

Performs the unary ! operation. Read more
Source§

impl Not for i56

Source§

type Output = i56

The resulting type after applying the ! operator.
Source§

fn not(self) -> i56

Performs the unary ! operation. Read more
Source§

impl Octal for i56

Source§

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

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

impl Ord for i56

Source§

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

Source§

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

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

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 i56

Source§

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

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

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

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

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

impl<T> Shl<T> for i56
where i64: Shl<T, Output = i64>,

Source§

type Output = i56

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: T) -> i56

Performs the << operation. Read more
Source§

impl<T> ShlAssign<T> for i56
where i64: ShlAssign<T>,

Source§

fn shl_assign(&mut self, rhs: T)

Performs the <<= operation. Read more
Source§

impl<T> Shr<T> for i56
where i64: Shr<T, Output = i64>,

Source§

type Output = i56

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: T) -> i56

Performs the >> operation. Read more
Source§

impl<T> ShrAssign<T> for i56
where i64: ShrAssign<T>,

Source§

fn shr_assign(&mut self, rhs: T)

Performs the >>= operation. Read more
Source§

impl Sub for i56

Source§

type Output = i56

The resulting type after applying the - operator.
Source§

fn sub(self, other: i56) -> i56

Performs the - operation. Read more
Source§

impl TryFrom<i56> for i24

Source§

type Error = TryFromIntError

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

fn try_from(x: i56) -> Result<i24, <i24 as TryFrom<i56>>::Error>

Performs the conversion.
Source§

impl TryFrom<i56> for i40

Source§

type Error = TryFromIntError

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

fn try_from(x: i56) -> Result<i40, <i40 as TryFrom<i56>>::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(x: i56) -> Result<i48, <i48 as TryFrom<i56>>::Error>

Performs the conversion.
Source§

impl TryFrom<i57> for i56

Source§

type Error = TryFromIntError

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

fn try_from(x: i57) -> Result<i56, <i56 as TryFrom<i57>>::Error>

Performs the conversion.
Source§

impl TryFrom<i58> for i56

Source§

type Error = TryFromIntError

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

fn try_from(x: i58) -> Result<i56, <i56 as TryFrom<i58>>::Error>

Performs the conversion.
Source§

impl TryFrom<i59> for i56

Source§

type Error = TryFromIntError

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

fn try_from(x: i59) -> Result<i56, <i56 as TryFrom<i59>>::Error>

Performs the conversion.
Source§

impl TryFrom<i60> for i56

Source§

type Error = TryFromIntError

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

fn try_from(x: i60) -> Result<i56, <i56 as TryFrom<i60>>::Error>

Performs the conversion.
Source§

impl TryFrom<i61> for i56

Source§

type Error = TryFromIntError

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

fn try_from(x: i61) -> Result<i56, <i56 as TryFrom<i61>>::Error>

Performs the conversion.
Source§

impl TryFrom<i62> for i56

Source§

type Error = TryFromIntError

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

fn try_from(x: i62) -> Result<i56, <i56 as TryFrom<i62>>::Error>

Performs the conversion.
Source§

impl TryFrom<i63> for i56

Source§

type Error = TryFromIntError

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

fn try_from(x: i63) -> Result<i56, <i56 as TryFrom<i63>>::Error>

Performs the conversion.
Source§

impl TryFrom<i64> for i56

Source§

type Error = TryFromIntError

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

fn try_from(x: i64) -> Result<i56, <i56 as TryFrom<i64>>::Error>

Performs the conversion.
Source§

impl UpperHex for i56

Source§

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

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

impl Copy for i56

Source§

impl Eq for i56

Auto Trait Implementations§

§

impl Freeze for i56

§

impl RefUnwindSafe for i56

§

impl Send for i56

§

impl Sync for i56

§

impl Unpin for i56

§

impl UnwindSafe for i56

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, B> EncoderExt<B> for T
where T: Encoder<B>,

Source§

fn encode_to(&self, buf: &mut B) -> Result<(), Self::Error>

Encodes self into buf. Read more
Source§

fn size(&self, buf: &B) -> usize

Returns the number of bytes required to encode self.
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,

Source§

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§

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

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.