Struct uavcan::types::i27[][src]

pub struct i27(_);

The 27-bit signed integer type.

Methods

impl i27
[src]

The 27-bit signed integer type.

MAX: i27 = i27(((1 as i32) << 27 - 1) - 1)

MIN: i27 = i27(-((1 as i32) << 27 - 1))

impl i27
[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 i27
[src]

impl Ord for i27
[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 i27
[src]

Formats the value using the given formatter.

impl Debug for i27
[src]

Formats the value using the given formatter. Read more

impl<T> ShlAssign<T> for i27 where
    i32: ShlAssign<T>, 
[src]

Performs the <<= operation.

impl Default for i27
[src]

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

impl Display for i27
[src]

Formats the value using the given formatter. Read more

impl<T> Shr<T> for i27 where
    i32: Shr<T>,
    <i32 as Shr<T>>::Output == i32, 
[src]

The resulting type after applying the >> operator.

Performs the >> operation.

impl Clone for i27
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

The resulting type after applying the | operator.

Performs the | operation.

impl BitOr<i27> for i27
[src]

The resulting type after applying the | operator.

Performs the | operation.

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

The resulting type after applying the | operator.

Performs the | operation.

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

The resulting type after applying the | operator.

Performs the | operation.

impl Hash for i27
[src]

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

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

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

Formats the value using the given formatter.

impl BitOrAssign<i27> for i27
[src]

Performs the |= operation.

impl UpperHex for i27
[src]

Formats the value using the given formatter.

impl<T> Shl<T> for i27 where
    i32: Shl<T>,
    <i32 as Shl<T>>::Output == i32, 
[src]

The resulting type after applying the << operator.

Performs the << operation.

impl From<i14> for i27
[src]

Performs the conversion.

impl From<i27> for i37
[src]

Performs the conversion.

impl From<i27> for i53
[src]

Performs the conversion.

impl From<i27> for i28
[src]

Performs the conversion.

impl From<i3> for i27
[src]

Performs the conversion.

impl From<i10> for i27
[src]

Performs the conversion.

impl From<i6> for i27
[src]

Performs the conversion.

impl From<i27> for i50
[src]

Performs the conversion.

impl From<i27> for i64
[src]

Performs the conversion.

impl From<i27> for i63
[src]

Performs the conversion.

impl From<i11> for i27
[src]

Performs the conversion.

impl From<i27> for i33
[src]

Performs the conversion.

impl From<i27> for i30
[src]

Performs the conversion.

impl From<i9> for i27
[src]

Performs the conversion.

impl From<i15> for i27
[src]

Performs the conversion.

impl From<i27> for i55
[src]

Performs the conversion.

impl From<i18> for i27
[src]

Performs the conversion.

impl From<i23> for i27
[src]

Performs the conversion.

impl From<i27> for i58
[src]

Performs the conversion.

impl From<i27> for i45
[src]

Performs the conversion.

impl From<i27> for i47
[src]

Performs the conversion.

impl From<i5> for i27
[src]

Performs the conversion.

impl From<i27> for i44
[src]

Performs the conversion.

impl From<i27> for i61
[src]

Performs the conversion.

impl From<i27> for i43
[src]

Performs the conversion.

impl From<i27> for i38
[src]

Performs the conversion.

impl From<i27> for i41
[src]

Performs the conversion.

impl From<i19> for i27
[src]

Performs the conversion.

impl From<i22> for i27
[src]

Performs the conversion.

impl From<i24> for i27
[src]

Performs the conversion.

impl From<i27> for i51
[src]

Performs the conversion.

impl From<i27> for i52
[src]

Performs the conversion.

impl From<i27> for i39
[src]

Performs the conversion.

impl From<i27> for i32
[src]

Performs the conversion.

impl From<i27> for i56
[src]

Performs the conversion.

impl From<i27> for i62
[src]

Performs the conversion.

impl From<i27> for i46
[src]

Performs the conversion.

impl From<i27> for i36
[src]

Performs the conversion.

impl From<i7> for i27
[src]

Performs the conversion.

impl From<i27> for i54
[src]

Performs the conversion.

impl From<i27> for i42
[src]

Performs the conversion.

impl From<i27> for i60
[src]

Performs the conversion.

impl From<i27> for i31
[src]

Performs the conversion.

impl From<i27> for i40
[src]

Performs the conversion.

impl From<i25> for i27
[src]

Performs the conversion.

impl From<i21> for i27
[src]

Performs the conversion.

impl From<i17> for i27
[src]

Performs the conversion.

impl From<i27> for i29
[src]

Performs the conversion.

impl From<i12> for i27
[src]

Performs the conversion.

impl From<i27> for i59
[src]

Performs the conversion.

impl From<i27> for i57
[src]

Performs the conversion.

impl From<i4> for i27
[src]

Performs the conversion.

impl From<i26> for i27
[src]

Performs the conversion.

impl From<i27> for i35
[src]

Performs the conversion.

impl From<i2> for i27
[src]

Performs the conversion.

impl From<i20> for i27
[src]

Performs the conversion.

impl From<i27> for i48
[src]

Performs the conversion.

impl From<i8> for i27
[src]

Performs the conversion.

impl From<i27> for i34
[src]

Performs the conversion.

impl From<i16> for i27
[src]

Performs the conversion.

impl From<i27> for i49
[src]

Performs the conversion.

impl From<i13> for i27
[src]

Performs the conversion.

impl PartialEq<i27> for i27
[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 i27 where
    i32: ShrAssign<T>, 
[src]

Performs the >>= operation.

impl Octal for i27
[src]

Formats the value using the given formatter.

impl Eq for i27
[src]

impl Serializable for i27
[src]

BIT_LENGTH_MIN: usize = 27

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 i27

impl Sync for i27