Struct ux::u17 [] [src]

pub struct u17(_);

The 17-bit unsigned integer type.

Methods

impl u17
[src]

MAX: Self = u17((1 as u32 << 17) - 1)

MIN: Self = u17(0)

impl u17
[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<u8> for u17
[src]

[src]

Performs the conversion.

impl From<u16> for u17
[src]

[src]

Performs the conversion.

impl From<u2> for u17
[src]

[src]

Performs the conversion.

impl From<u3> for u17
[src]

[src]

Performs the conversion.

impl From<u4> for u17
[src]

[src]

Performs the conversion.

impl From<u5> for u17
[src]

[src]

Performs the conversion.

impl From<u6> for u17
[src]

[src]

Performs the conversion.

impl From<u7> for u17
[src]

[src]

Performs the conversion.

impl From<u9> for u17
[src]

[src]

Performs the conversion.

impl From<u10> for u17
[src]

[src]

Performs the conversion.

impl From<u11> for u17
[src]

[src]

Performs the conversion.

impl From<u12> for u17
[src]

[src]

Performs the conversion.

impl From<u13> for u17
[src]

[src]

Performs the conversion.

impl From<u14> for u17
[src]

[src]

Performs the conversion.

impl From<u15> for u17
[src]

[src]

Performs the conversion.

impl Default for u17
[src]

[src]

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

impl Clone for u17
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for u17
[src]

impl Debug for u17
[src]

[src]

Formats the value using the given formatter.

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

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

[src]

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

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl Hash for u17
[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 u17
[src]

[src]

Formats the value using the given formatter. Read more

impl UpperHex for u17
[src]

[src]

Formats the value using the given formatter.

impl LowerHex for u17
[src]

[src]

Formats the value using the given formatter.

impl Octal for u17
[src]

[src]

Formats the value using the given formatter.

impl Binary for u17
[src]

[src]

Formats the value using the given formatter.

impl<T> Shr<T> for u17 where
    u32: Shr<T, Output = u32>, 
[src]

The resulting type after applying the >> operator.

[src]

Performs the >> operation.

impl<T> Shl<T> for u17 where
    u32: Shl<T, Output = u32>, 
[src]

The resulting type after applying the << operator.

[src]

Performs the << operation.

impl<T> ShrAssign<T> for u17 where
    u32: ShrAssign<T>, 
[src]

[src]

Performs the >>= operation.

impl<T> ShlAssign<T> for u17 where
    u32: ShlAssign<T>, 
[src]

[src]

Performs the <<= operation.

impl BitOr<u17> for u17
[src]

The resulting type after applying the | operator.

[src]

Performs the | operation.

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

The resulting type after applying the | operator.

[src]

Performs the | operation.

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

The resulting type after applying the | operator.

[src]

Performs the | operation.

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

The resulting type after applying the | operator.

[src]

Performs the | operation.

impl BitOrAssign<u17> for u17
[src]

[src]

Performs the |= operation.