Struct uavcan::types::u28 [−][src]
pub struct u28(_);
The 28-bit unsigned integer type.
Methods
impl u28
[src]
impl u28
impl u28
[src]
impl u28
pub fn min_value() -> u28
[src]
pub fn min_value() -> u28
Returns the smallest value that can be represented by this integer type.
pub fn max_value() -> u28
[src]
pub fn max_value() -> u28
Returns the largest value that can be represented by this integer type.
pub fn new(value: u32) -> u28
[src]
pub fn new(value: u32) -> u28
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
pub fn wrapping_sub(self, rhs: u28) -> u28
[src]
pub fn wrapping_sub(self, rhs: u28) -> u28
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));
pub fn wrapping_add(self, rhs: u28) -> u28
[src]
pub fn wrapping_add(self, rhs: u28) -> u28
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 Copy for u28
impl Ord for u28
[src]
impl Ord for u28
fn cmp(&self, other: &u28) -> Ordering
[src]
fn cmp(&self, other: &u28) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Binary for u28
[src]
impl Binary for u28
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl Debug for u28
[src]
impl Debug for u28
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<T> ShlAssign<T> for u28 where
u32: ShlAssign<T>,
[src]
impl<T> ShlAssign<T> for u28 where
u32: ShlAssign<T>,
fn shl_assign(&mut self, rhs: T)
[src]
fn shl_assign(&mut self, rhs: T)
Performs the <<=
operation.
impl Default for u28
[src]
impl Default for u28
impl Display for u28
[src]
impl Display for u28
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
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]
impl<T> Shr<T> for u28 where
u32: Shr<T>,
<u32 as Shr<T>>::Output == u32,
type Output = u28
The resulting type after applying the >>
operator.
fn shr(self, rhs: T) -> u28
[src]
fn shr(self, rhs: T) -> u28
Performs the >>
operation.
impl Clone for u28
[src]
impl Clone for u28
fn clone(&self) -> u28
[src]
fn clone(&self) -> u28
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl BitOr<u28> for u28
[src]
impl BitOr<u28> for u28
type Output = u28
The resulting type after applying the |
operator.
fn bitor(self, rhs: u28) -> <u28 as BitOr<u28>>::Output
[src]
fn bitor(self, rhs: u28) -> <u28 as BitOr<u28>>::Output
Performs the |
operation.
impl<'a> BitOr<&'a u28> for &'a u28
[src]
impl<'a> BitOr<&'a u28> for &'a u28
type Output = <u28 as BitOr<u28>>::Output
The resulting type after applying the |
operator.
fn bitor(self, rhs: &'a u28) -> <&'a u28 as BitOr<&'a u28>>::Output
[src]
fn bitor(self, rhs: &'a u28) -> <&'a u28 as BitOr<&'a u28>>::Output
Performs the |
operation.
impl<'a> BitOr<&'a u28> for u28
[src]
impl<'a> BitOr<&'a u28> for u28
type Output = <u28 as BitOr<u28>>::Output
The resulting type after applying the |
operator.
fn bitor(self, rhs: &'a u28) -> <u28 as BitOr<&'a u28>>::Output
[src]
fn bitor(self, rhs: &'a u28) -> <u28 as BitOr<&'a u28>>::Output
Performs the |
operation.
impl<'a> BitOr<u28> for &'a u28
[src]
impl<'a> BitOr<u28> for &'a u28
type Output = <u28 as BitOr<u28>>::Output
The resulting type after applying the |
operator.
fn bitor(self, rhs: u28) -> <&'a u28 as BitOr<u28>>::Output
[src]
fn bitor(self, rhs: u28) -> <&'a u28 as BitOr<u28>>::Output
Performs the |
operation.
impl Hash for u28
[src]
impl Hash for u28
fn hash<H>(&self, h: &mut H) where
H: Hasher,
[src]
fn hash<H>(&self, h: &mut H) where
H: Hasher,
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialOrd<u28> for u28
[src]
impl PartialOrd<u28> for u28
fn partial_cmp(&self, other: &u28) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &u28) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
fn ge(&self, other: &Rhs) -> bool
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]
impl LowerHex for u28
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl BitOrAssign<u28> for u28
[src]
impl BitOrAssign<u28> for u28
fn bitor_assign(&mut self, other: u28)
[src]
fn bitor_assign(&mut self, other: u28)
Performs the |=
operation.
impl UpperHex for u28
[src]
impl UpperHex for u28
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl<T> Shl<T> for u28 where
u32: Shl<T>,
<u32 as Shl<T>>::Output == u32,
[src]
impl<T> Shl<T> for u28 where
u32: Shl<T>,
<u32 as Shl<T>>::Output == u32,
type Output = u28
The resulting type after applying the <<
operator.
fn shl(self, rhs: T) -> u28
[src]
fn shl(self, rhs: T) -> u28
Performs the <<
operation.
impl From<u28> for u49
[src]
impl From<u28> for u49
impl From<u28> for u57
[src]
impl From<u28> for u57
impl From<u21> for u28
[src]
impl From<u21> for u28
impl From<u28> for u36
[src]
impl From<u28> for u36
impl From<u28> for u59
[src]
impl From<u28> for u59
impl From<u11> for u28
[src]
impl From<u11> for u28
impl From<u28> for u39
[src]
impl From<u28> for u39
impl From<u28> for u58
[src]
impl From<u28> for u58
impl From<u28> for u55
[src]
impl From<u28> for u55
impl From<u20> for u28
[src]
impl From<u20> for u28
impl From<u10> for u28
[src]
impl From<u10> for u28
impl From<u28> for u30
[src]
impl From<u28> for u30
impl From<u28> for u32
[src]
impl From<u28> for u32
impl From<u28> for u60
[src]
impl From<u28> for u60
impl From<u14> for u28
[src]
impl From<u14> for u28
impl From<u28> for u61
[src]
impl From<u28> for u61
impl From<u18> for u28
[src]
impl From<u18> for u28
impl From<u25> for u28
[src]
impl From<u25> for u28
impl From<u8> for u28
[src]
impl From<u8> for u28
impl From<u28> for u41
[src]
impl From<u28> for u41
impl From<u28> for u48
[src]
impl From<u28> for u48
impl From<u9> for u28
[src]
impl From<u9> for u28
impl From<u28> for u29
[src]
impl From<u28> for u29
impl From<u28> for u62
[src]
impl From<u28> for u62
impl From<u28> for u31
[src]
impl From<u28> for u31
impl From<u17> for u28
[src]
impl From<u17> for u28
impl From<u23> for u28
[src]
impl From<u23> for u28
impl From<u16> for u28
[src]
impl From<u16> for u28
impl From<u7> for u28
[src]
impl From<u7> for u28
impl From<u28> for u43
[src]
impl From<u28> for u43
impl From<u28> for u47
[src]
impl From<u28> for u47
impl From<u28> for u33
[src]
impl From<u28> for u33
impl From<u2> for u28
[src]
impl From<u2> for u28
impl From<u26> for u28
[src]
impl From<u26> for u28
impl From<u28> for u45
[src]
impl From<u28> for u45
impl From<u28> for u37
[src]
impl From<u28> for u37
impl From<u28> for u50
[src]
impl From<u28> for u50
impl From<u3> for u28
[src]
impl From<u3> for u28
impl From<u6> for u28
[src]
impl From<u6> for u28
impl From<u28> for u42
[src]
impl From<u28> for u42
impl From<u5> for u28
[src]
impl From<u5> for u28
impl From<u28> for u54
[src]
impl From<u28> for u54
impl From<u28> for u38
[src]
impl From<u28> for u38
impl From<u28> for u35
[src]
impl From<u28> for u35
impl From<u27> for u28
[src]
impl From<u27> for u28
impl From<u12> for u28
[src]
impl From<u12> for u28
impl From<u24> for u28
[src]
impl From<u24> for u28
impl From<u15> for u28
[src]
impl From<u15> for u28
impl From<u13> for u28
[src]
impl From<u13> for u28
impl From<u28> for u34
[src]
impl From<u28> for u34
impl From<u4> for u28
[src]
impl From<u4> for u28
impl From<u28> for u40
[src]
impl From<u28> for u40
impl From<u28> for u53
[src]
impl From<u28> for u53
impl From<u28> for u46
[src]
impl From<u28> for u46
impl From<u28> for u44
[src]
impl From<u28> for u44
impl From<u28> for u52
[src]
impl From<u28> for u52
impl From<u22> for u28
[src]
impl From<u22> for u28
impl From<u28> for u64
[src]
impl From<u28> for u64
impl From<u28> for u63
[src]
impl From<u28> for u63
impl From<u28> for u56
[src]
impl From<u28> for u56
impl From<u19> for u28
[src]
impl From<u19> for u28
impl From<u28> for u51
[src]
impl From<u28> for u51
impl PartialEq<u28> for u28
[src]
impl PartialEq<u28> for u28
fn eq(&self, other: &u28) -> bool
[src]
fn eq(&self, other: &u28) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<T> ShrAssign<T> for u28 where
u32: ShrAssign<T>,
[src]
impl<T> ShrAssign<T> for u28 where
u32: ShrAssign<T>,
fn shr_assign(&mut self, rhs: T)
[src]
fn shr_assign(&mut self, rhs: T)
Performs the >>=
operation.
impl Octal for u28
[src]
impl Octal for u28
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter.
impl Eq for u28
[src]
impl Eq for u28
impl Serializable for u28
[src]
impl Serializable for u28
const BIT_LENGTH_MIN: usize
BIT_LENGTH_MIN: usize = 28
The minimum bit length an uavcan type can have Read more
const FLATTENED_FIELDS_NUMBER: usize
FLATTENED_FIELDS_NUMBER: usize = 1
Number of primitive fields after flattening of data type. Read more
fn serialize(
&self,
flattened_field: &mut usize,
bit: &mut usize,
_last_field: bool,
buffer: &mut SerializationBuffer
) -> SerializationResult
[src]
fn serialize(
&self,
flattened_field: &mut usize,
bit: &mut usize,
_last_field: bool,
buffer: &mut SerializationBuffer
) -> SerializationResult
fn deserialize(
&mut self,
flattened_field: &mut usize,
bit: &mut usize,
_last_field: bool,
buffer: &mut DeserializationBuffer
) -> DeserializationResult
[src]
fn deserialize(
&mut self,
flattened_field: &mut usize,
bit: &mut usize,
_last_field: bool,
buffer: &mut DeserializationBuffer
) -> DeserializationResult