Struct ux::i58 [] [src]

pub struct i58(_);

The 58-bit signed integer type.

Methods

impl i58
[src]

The 58-bit signed integer type.

MAX: Self = i58(((1 as i64) << 58 - 1) - 1)

MIN: Self = i58(-((1 as i64) << 58 - 1))

impl i58
[src]

[src]

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

[src]

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

[src]

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

[src]

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));

[src]

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

impl From<i8> for i58
[src]

[src]

Performs the conversion.

impl From<i16> for i58
[src]

[src]

Performs the conversion.

impl From<i32> for i58
[src]

[src]

Performs the conversion.

impl From<i58> for i64
[src]

[src]

Performs the conversion.

impl From<i2> for i58
[src]

[src]

Performs the conversion.

impl From<i3> for i58
[src]

[src]

Performs the conversion.

impl From<i4> for i58
[src]

[src]

Performs the conversion.

impl From<i5> for i58
[src]

[src]

Performs the conversion.

impl From<i6> for i58
[src]

[src]

Performs the conversion.

impl From<i7> for i58
[src]

[src]

Performs the conversion.

impl From<i9> for i58
[src]

[src]

Performs the conversion.

impl From<i10> for i58
[src]

[src]

Performs the conversion.

impl From<i11> for i58
[src]

[src]

Performs the conversion.

impl From<i12> for i58
[src]

[src]

Performs the conversion.

impl From<i13> for i58
[src]

[src]

Performs the conversion.

impl From<i14> for i58
[src]

[src]

Performs the conversion.

impl From<i15> for i58
[src]

[src]

Performs the conversion.

impl From<i17> for i58
[src]

[src]

Performs the conversion.

impl From<i18> for i58
[src]

[src]

Performs the conversion.

impl From<i19> for i58
[src]

[src]

Performs the conversion.

impl From<i20> for i58
[src]

[src]

Performs the conversion.

impl From<i21> for i58
[src]

[src]

Performs the conversion.

impl From<i22> for i58
[src]

[src]

Performs the conversion.

impl From<i23> for i58
[src]

[src]

Performs the conversion.

impl From<i24> for i58
[src]

[src]

Performs the conversion.

impl From<i25> for i58
[src]

[src]

Performs the conversion.

impl From<i26> for i58
[src]

[src]

Performs the conversion.

impl From<i27> for i58
[src]

[src]

Performs the conversion.

impl From<i28> for i58
[src]

[src]

Performs the conversion.

impl From<i29> for i58
[src]

[src]

Performs the conversion.

impl From<i30> for i58
[src]

[src]

Performs the conversion.

impl From<i31> for i58
[src]

[src]

Performs the conversion.

impl From<i33> for i58
[src]

[src]

Performs the conversion.

impl From<i34> for i58
[src]

[src]

Performs the conversion.

impl From<i35> for i58
[src]

[src]

Performs the conversion.

impl From<i36> for i58
[src]

[src]

Performs the conversion.

impl From<i37> for i58
[src]

[src]

Performs the conversion.

impl From<i38> for i58
[src]

[src]

Performs the conversion.

impl From<i39> for i58
[src]

[src]

Performs the conversion.

impl From<i40> for i58
[src]

[src]

Performs the conversion.

impl From<i41> for i58
[src]

[src]

Performs the conversion.

impl From<i42> for i58
[src]

[src]

Performs the conversion.

impl From<i43> for i58
[src]

[src]

Performs the conversion.

impl From<i44> for i58
[src]

[src]

Performs the conversion.

impl From<i45> for i58
[src]

[src]

Performs the conversion.

impl From<i46> for i58
[src]

[src]

Performs the conversion.

impl From<i47> for i58
[src]

[src]

Performs the conversion.

impl From<i48> for i58
[src]

[src]

Performs the conversion.

impl From<i49> for i58
[src]

[src]

Performs the conversion.

impl From<i50> for i58
[src]

[src]

Performs the conversion.

impl From<i51> for i58
[src]

[src]

Performs the conversion.

impl From<i52> for i58
[src]

[src]

Performs the conversion.

impl From<i53> for i58
[src]

[src]

Performs the conversion.

impl From<i54> for i58
[src]

[src]

Performs the conversion.

impl From<i55> for i58
[src]

[src]

Performs the conversion.

impl From<i56> for i58
[src]

[src]

Performs the conversion.

impl From<i57> for i58
[src]

[src]

Performs the conversion.

impl From<i58> for i59
[src]

[src]

Performs the conversion.

impl From<i58> for i60
[src]

[src]

Performs the conversion.

impl From<i58> for i61
[src]

[src]

Performs the conversion.

impl From<i58> for i62
[src]

[src]

Performs the conversion.

impl From<i58> for i63
[src]

[src]

Performs the conversion.

impl Default for i58
[src]

[src]

Returns the "default value" for a type. Read more

impl Clone for i58
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for i58
[src]

impl Debug for i58
[src]

[src]

Formats the value using the given formatter. Read more

impl PartialEq for i58
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl Eq for i58
[src]

impl PartialOrd for i58
[src]

[src]

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

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for i58
[src]

[src]

This method returns an Ordering between self and other. Read more

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl Hash for i58
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Display for i58
[src]

[src]

Formats the value using the given formatter. Read more

impl UpperHex for i58
[src]

[src]

Formats the value using the given formatter.

impl LowerHex for i58
[src]

[src]

Formats the value using the given formatter.

impl Octal for i58
[src]

[src]

Formats the value using the given formatter.

impl Binary for i58
[src]

[src]

Formats the value using the given formatter.

impl<T> Shr<T> for i58 where
    i64: Shr<T, Output = i64>, 
[src]

The resulting type after applying the >> operator.

[src]

Performs the >> operation.

impl<T> Shl<T> for i58 where
    i64: Shl<T, Output = i64>, 
[src]

The resulting type after applying the << operator.

[src]

Performs the << operation.

impl<T> ShrAssign<T> for i58 where
    i64: ShrAssign<T>, 
[src]

[src]

Performs the >>= operation.

impl<T> ShlAssign<T> for i58 where
    i64: ShlAssign<T>, 
[src]

[src]

Performs the <<= operation.

impl BitOr<i58> for i58
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl<'a> BitOr<&'a i58> for i58
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl<'a> BitOr<i58> for &'a i58
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl<'a> BitOr<&'a i58> for &'a i58
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl BitOrAssign<i58> for i58
[src]

[src]

Performs the |= operation.

impl BitXor<i58> for i58
[src]

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl<'a> BitXor<&'a i58> for i58
[src]

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl<'a> BitXor<i58> for &'a i58
[src]

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl<'a> BitXor<&'a i58> for &'a i58
[src]

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl BitXorAssign<i58> for i58
[src]

[src]

Performs the ^= operation.

impl Not for i58
[src]

The resulting type after applying the ! operator.

[src]

Performs the unary ! operation.

impl<'a> Not for &'a i58
[src]

The resulting type after applying the ! operator.

[src]

Performs the unary ! operation.

impl BitAnd<i58> for i58
[src]

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl<'a> BitAnd<&'a i58> for i58
[src]

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl<'a> BitAnd<i58> for &'a i58
[src]

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl<'a> BitAnd<&'a i58> for &'a i58
[src]

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl BitAndAssign<i58> for i58
[src]

[src]

Performs the &= operation.

impl Add<i58> for i58
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Sub<i58> for i58
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

Auto Trait Implementations

impl Send for i58

impl Sync for i58