[][src]Struct ux::u7

pub struct u7(_);

The 7-bit unsigned integer type.

Methods

impl u7
[src]

impl u7
[src]

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

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

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

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

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 Clone for u7
[src]

Performs copy-assignment from source. Read more

impl Copy for u7
[src]

impl From<u7> for u8
[src]

impl From<u7> for u16
[src]

impl From<u7> for u32
[src]

impl From<u7> for u64
[src]

impl From<u2> for u7
[src]

impl From<u3> for u7
[src]

impl From<u4> for u7
[src]

impl From<u5> for u7
[src]

impl From<u6> for u7
[src]

impl From<u7> for u9
[src]

impl From<u7> for u10
[src]

impl From<u7> for u11
[src]

impl From<u7> for u12
[src]

impl From<u7> for u13
[src]

impl From<u7> for u14
[src]

impl From<u7> for u15
[src]

impl From<u7> for u17
[src]

impl From<u7> for u18
[src]

impl From<u7> for u19
[src]

impl From<u7> for u20
[src]

impl From<u7> for u21
[src]

impl From<u7> for u22
[src]

impl From<u7> for u23
[src]

impl From<u7> for u24
[src]

impl From<u7> for u25
[src]

impl From<u7> for u26
[src]

impl From<u7> for u27
[src]

impl From<u7> for u28
[src]

impl From<u7> for u29
[src]

impl From<u7> for u30
[src]

impl From<u7> for u31
[src]

impl From<u7> for u33
[src]

impl From<u7> for u34
[src]

impl From<u7> for u35
[src]

impl From<u7> for u36
[src]

impl From<u7> for u37
[src]

impl From<u7> for u38
[src]

impl From<u7> for u39
[src]

impl From<u7> for u40
[src]

impl From<u7> for u41
[src]

impl From<u7> for u42
[src]

impl From<u7> for u43
[src]

impl From<u7> for u44
[src]

impl From<u7> for u45
[src]

impl From<u7> for u46
[src]

impl From<u7> for u47
[src]

impl From<u7> for u48
[src]

impl From<u7> for u49
[src]

impl From<u7> for u50
[src]

impl From<u7> for u51
[src]

impl From<u7> for u52
[src]

impl From<u7> for u53
[src]

impl From<u7> for u54
[src]

impl From<u7> for u55
[src]

impl From<u7> for u56
[src]

impl From<u7> for u57
[src]

impl From<u7> for u58
[src]

impl From<u7> for u59
[src]

impl From<u7> for u60
[src]

impl From<u7> for u61
[src]

impl From<u7> for u62
[src]

impl From<u7> for u63
[src]

impl Eq for u7
[src]

impl PartialOrd<u7> for u7
[src]

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

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

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

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

impl Default for u7
[src]

impl PartialEq<u7> for u7
[src]

This method tests for !=.

impl Ord for u7
[src]

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Display for u7
[src]

impl Debug for u7
[src]

impl Add<u7> for u7
[src]

The resulting type after applying the + operator.

impl Sub<u7> for u7
[src]

The resulting type after applying the - operator.

impl Not for u7
[src]

The resulting type after applying the ! operator.

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

The resulting type after applying the ! operator.

impl BitAnd<u7> for u7
[src]

The resulting type after applying the & operator.

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

The resulting type after applying the & operator.

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

The resulting type after applying the & operator.

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

The resulting type after applying the & operator.

impl BitOr<u7> for u7
[src]

The resulting type after applying the | operator.

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

The resulting type after applying the | operator.

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

The resulting type after applying the | operator.

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

The resulting type after applying the | operator.

impl BitXor<u7> for u7
[src]

The resulting type after applying the ^ operator.

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

The resulting type after applying the ^ operator.

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

The resulting type after applying the ^ operator.

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

The resulting type after applying the ^ operator.

impl<T> Shl<T> for u7 where
    u8: Shl<T, Output = u8>, 
[src]

The resulting type after applying the << operator.

impl<T> Shr<T> for u7 where
    u8: Shr<T, Output = u8>, 
[src]

The resulting type after applying the >> operator.

impl BitAndAssign<u7> for u7
[src]

impl BitOrAssign<u7> for u7
[src]

impl BitXorAssign<u7> for u7
[src]

impl<T> ShlAssign<T> for u7 where
    u8: ShlAssign<T>, 
[src]

impl<T> ShrAssign<T> for u7 where
    u8: ShrAssign<T>, 
[src]

impl Hash for u7
[src]

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

impl Octal for u7
[src]

impl Binary for u7
[src]

impl LowerHex for u7
[src]

impl UpperHex for u7
[src]

Auto Trait Implementations

impl Send for u7

impl Sync for u7

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]