Struct ux::i6 [] [src]

pub struct i6(_);

The 6-bit signed integer type.

Methods

impl i6
[src]

The 6-bit signed integer type.

MAX: Self = i6(((1 as i8) << 6 - 1) - 1)

MIN: Self = i6(-((1 as i8) << 6 - 1))

impl i6
[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<i6> for i8
[src]

[src]

Performs the conversion.

impl From<i6> for i16
[src]

[src]

Performs the conversion.

impl From<i6> for i32
[src]

[src]

Performs the conversion.

impl From<i6> for i64
[src]

[src]

Performs the conversion.

impl From<i2> for i6
[src]

[src]

Performs the conversion.

impl From<i3> for i6
[src]

[src]

Performs the conversion.

impl From<i4> for i6
[src]

[src]

Performs the conversion.

impl From<i5> for i6
[src]

[src]

Performs the conversion.

impl From<i6> for i7
[src]

[src]

Performs the conversion.

impl From<i6> for i9
[src]

[src]

Performs the conversion.

impl From<i6> for i10
[src]

[src]

Performs the conversion.

impl From<i6> for i11
[src]

[src]

Performs the conversion.

impl From<i6> for i12
[src]

[src]

Performs the conversion.

impl From<i6> for i13
[src]

[src]

Performs the conversion.

impl From<i6> for i14
[src]

[src]

Performs the conversion.

impl From<i6> for i15
[src]

[src]

Performs the conversion.

impl From<i6> for i17
[src]

[src]

Performs the conversion.

impl From<i6> for i18
[src]

[src]

Performs the conversion.

impl From<i6> for i19
[src]

[src]

Performs the conversion.

impl From<i6> for i20
[src]

[src]

Performs the conversion.

impl From<i6> for i21
[src]

[src]

Performs the conversion.

impl From<i6> for i22
[src]

[src]

Performs the conversion.

impl From<i6> for i23
[src]

[src]

Performs the conversion.

impl From<i6> for i24
[src]

[src]

Performs the conversion.

impl From<i6> for i25
[src]

[src]

Performs the conversion.

impl From<i6> for i26
[src]

[src]

Performs the conversion.

impl From<i6> for i27
[src]

[src]

Performs the conversion.

impl From<i6> for i28
[src]

[src]

Performs the conversion.

impl From<i6> for i29
[src]

[src]

Performs the conversion.

impl From<i6> for i30
[src]

[src]

Performs the conversion.

impl From<i6> for i31
[src]

[src]

Performs the conversion.

impl From<i6> for i33
[src]

[src]

Performs the conversion.

impl From<i6> for i34
[src]

[src]

Performs the conversion.

impl From<i6> for i35
[src]

[src]

Performs the conversion.

impl From<i6> for i36
[src]

[src]

Performs the conversion.

impl From<i6> for i37
[src]

[src]

Performs the conversion.

impl From<i6> for i38
[src]

[src]

Performs the conversion.

impl From<i6> for i39
[src]

[src]

Performs the conversion.

impl From<i6> for i40
[src]

[src]

Performs the conversion.

impl From<i6> for i41
[src]

[src]

Performs the conversion.

impl From<i6> for i42
[src]

[src]

Performs the conversion.

impl From<i6> for i43
[src]

[src]

Performs the conversion.

impl From<i6> for i44
[src]

[src]

Performs the conversion.

impl From<i6> for i45
[src]

[src]

Performs the conversion.

impl From<i6> for i46
[src]

[src]

Performs the conversion.

impl From<i6> for i47
[src]

[src]

Performs the conversion.

impl From<i6> for i48
[src]

[src]

Performs the conversion.

impl From<i6> for i49
[src]

[src]

Performs the conversion.

impl From<i6> for i50
[src]

[src]

Performs the conversion.

impl From<i6> for i51
[src]

[src]

Performs the conversion.

impl From<i6> for i52
[src]

[src]

Performs the conversion.

impl From<i6> for i53
[src]

[src]

Performs the conversion.

impl From<i6> for i54
[src]

[src]

Performs the conversion.

impl From<i6> for i55
[src]

[src]

Performs the conversion.

impl From<i6> for i56
[src]

[src]

Performs the conversion.

impl From<i6> for i57
[src]

[src]

Performs the conversion.

impl From<i6> for i58
[src]

[src]

Performs the conversion.

impl From<i6> for i59
[src]

[src]

Performs the conversion.

impl From<i6> for i60
[src]

[src]

Performs the conversion.

impl From<i6> for i61
[src]

[src]

Performs the conversion.

impl From<i6> for i62
[src]

[src]

Performs the conversion.

impl From<i6> for i63
[src]

[src]

Performs the conversion.

impl Default for i6
[src]

[src]

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

impl Clone for i6
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for i6
[src]

impl Debug for i6
[src]

[src]

Formats the value using the given formatter. Read more

impl PartialEq for i6
[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 i6
[src]

impl PartialOrd for i6
[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 i6
[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 i6
[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 i6
[src]

[src]

Formats the value using the given formatter. Read more

impl UpperHex for i6
[src]

[src]

Formats the value using the given formatter.

impl LowerHex for i6
[src]

[src]

Formats the value using the given formatter.

impl Octal for i6
[src]

[src]

Formats the value using the given formatter.

impl Binary for i6
[src]

[src]

Formats the value using the given formatter.

impl<T> Shr<T> for i6 where
    i8: Shr<T, Output = i8>, 
[src]

The resulting type after applying the >> operator.

[src]

Performs the >> operation.

impl<T> Shl<T> for i6 where
    i8: Shl<T, Output = i8>, 
[src]

The resulting type after applying the << operator.

[src]

Performs the << operation.

impl<T> ShrAssign<T> for i6 where
    i8: ShrAssign<T>, 
[src]

[src]

Performs the >>= operation.

impl<T> ShlAssign<T> for i6 where
    i8: ShlAssign<T>, 
[src]

[src]

Performs the <<= operation.

impl BitOr<i6> for i6
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

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

The resulting type after applying the | operator.

[src]

Performs the | operation.

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

The resulting type after applying the | operator.

[src]

Performs the | operation.

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

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl BitOrAssign<i6> for i6
[src]

[src]

Performs the |= operation.

impl BitXor<i6> for i6
[src]

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

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

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

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

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

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

The resulting type after applying the ^ operator.

[src]

Performs the ^ operation.

impl BitXorAssign<i6> for i6
[src]

[src]

Performs the ^= operation.

impl Not for i6
[src]

The resulting type after applying the ! operator.

[src]

Performs the unary ! operation.

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

The resulting type after applying the ! operator.

[src]

Performs the unary ! operation.

impl BitAnd<i6> for i6
[src]

The resulting type after applying the & operator.

[src]

Performs the & operation.

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

The resulting type after applying the & operator.

[src]

Performs the & operation.

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

The resulting type after applying the & operator.

[src]

Performs the & operation.

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

The resulting type after applying the & operator.

[src]

Performs the & operation.

impl BitAndAssign<i6> for i6
[src]

[src]

Performs the &= operation.

impl Add<i6> for i6
[src]

The resulting type after applying the + operator.

[src]

Performs the + operation.

impl Sub<i6> for i6
[src]

The resulting type after applying the - operator.

[src]

Performs the - operation.

Auto Trait Implementations

impl Send for i6

impl Sync for i6