Struct uavcan::types::u28[][src]

pub struct u28(_);

The 28-bit unsigned integer type.

Methods

impl u28
[src]

MAX: u28 = u28(((1 as u32) << 28) - 1)

MIN: u28 = u28(0)

impl u28
[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 Copy for u28
[src]

impl Ord for u28
[src]

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

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Binary for u28
[src]

Formats the value using the given formatter.

impl Debug for u28
[src]

Formats the value using the given formatter. Read more

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

Performs the <<= operation.

impl Default for u28
[src]

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

impl Display for u28
[src]

Formats the value using the given formatter. Read more

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

The resulting type after applying the >> operator.

Performs the >> operation.

impl Clone for u28
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl BitOr<u28> for u28
[src]

The resulting type after applying the | operator.

Performs the | operation.

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

The resulting type after applying the | operator.

Performs the | operation.

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

The resulting type after applying the | operator.

Performs the | operation.

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

The resulting type after applying the | operator.

Performs the | operation.

impl Hash for u28
[src]

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

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

impl PartialOrd<u28> for u28
[src]

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

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 LowerHex for u28
[src]

Formats the value using the given formatter.

impl BitOrAssign<u28> for u28
[src]

Performs the |= operation.

impl UpperHex for u28
[src]

Formats the value using the given formatter.

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

The resulting type after applying the << operator.

Performs the << operation.

impl From<u28> for u49
[src]

Performs the conversion.

impl From<u28> for u57
[src]

Performs the conversion.

impl From<u21> for u28
[src]

Performs the conversion.

impl From<u28> for u36
[src]

Performs the conversion.

impl From<u28> for u59
[src]

Performs the conversion.

impl From<u11> for u28
[src]

Performs the conversion.

impl From<u28> for u39
[src]

Performs the conversion.

impl From<u28> for u58
[src]

Performs the conversion.

impl From<u28> for u55
[src]

Performs the conversion.

impl From<u20> for u28
[src]

Performs the conversion.

impl From<u10> for u28
[src]

Performs the conversion.

impl From<u28> for u30
[src]

Performs the conversion.

impl From<u28> for u32
[src]

Performs the conversion.

impl From<u28> for u60
[src]

Performs the conversion.

impl From<u14> for u28
[src]

Performs the conversion.

impl From<u28> for u61
[src]

Performs the conversion.

impl From<u18> for u28
[src]

Performs the conversion.

impl From<u25> for u28
[src]

Performs the conversion.

impl From<u8> for u28
[src]

Performs the conversion.

impl From<u28> for u41
[src]

Performs the conversion.

impl From<u28> for u48
[src]

Performs the conversion.

impl From<u9> for u28
[src]

Performs the conversion.

impl From<u28> for u29
[src]

Performs the conversion.

impl From<u28> for u62
[src]

Performs the conversion.

impl From<u28> for u31
[src]

Performs the conversion.

impl From<u17> for u28
[src]

Performs the conversion.

impl From<u23> for u28
[src]

Performs the conversion.

impl From<u16> for u28
[src]

Performs the conversion.

impl From<u7> for u28
[src]

Performs the conversion.

impl From<u28> for u43
[src]

Performs the conversion.

impl From<u28> for u47
[src]

Performs the conversion.

impl From<u28> for u33
[src]

Performs the conversion.

impl From<u2> for u28
[src]

Performs the conversion.

impl From<u26> for u28
[src]

Performs the conversion.

impl From<u28> for u45
[src]

Performs the conversion.

impl From<u28> for u37
[src]

Performs the conversion.

impl From<u28> for u50
[src]

Performs the conversion.

impl From<u3> for u28
[src]

Performs the conversion.

impl From<u6> for u28
[src]

Performs the conversion.

impl From<u28> for u42
[src]

Performs the conversion.

impl From<u5> for u28
[src]

Performs the conversion.

impl From<u28> for u54
[src]

Performs the conversion.

impl From<u28> for u38
[src]

Performs the conversion.

impl From<u28> for u35
[src]

Performs the conversion.

impl From<u27> for u28
[src]

Performs the conversion.

impl From<u12> for u28
[src]

Performs the conversion.

impl From<u24> for u28
[src]

Performs the conversion.

impl From<u15> for u28
[src]

Performs the conversion.

impl From<u13> for u28
[src]

Performs the conversion.

impl From<u28> for u34
[src]

Performs the conversion.

impl From<u4> for u28
[src]

Performs the conversion.

impl From<u28> for u40
[src]

Performs the conversion.

impl From<u28> for u53
[src]

Performs the conversion.

impl From<u28> for u46
[src]

Performs the conversion.

impl From<u28> for u44
[src]

Performs the conversion.

impl From<u28> for u52
[src]

Performs the conversion.

impl From<u22> for u28
[src]

Performs the conversion.

impl From<u28> for u64
[src]

Performs the conversion.

impl From<u28> for u63
[src]

Performs the conversion.

impl From<u28> for u56
[src]

Performs the conversion.

impl From<u19> for u28
[src]

Performs the conversion.

impl From<u28> for u51
[src]

Performs the conversion.

impl PartialEq<u28> for u28
[src]

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

This method tests for !=.

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

Performs the >>= operation.

impl Octal for u28
[src]

Formats the value using the given formatter.

impl Eq for u28
[src]

impl Serializable for u28
[src]

BIT_LENGTH_MIN: usize = 28

The minimum bit length an uavcan type can have Read more

FLATTENED_FIELDS_NUMBER: usize = 1

Number of primitive fields after flattening of data type. Read more

Auto Trait Implementations

impl Send for u28

impl Sync for u28