Struct uavcan::types::i27 [−][src]
pub struct i27(_);
The 27-bit signed integer type.
Methods
impl i27
[src]
impl i27
The 27-bit signed integer type.
pub const MAX: i27
MAX: i27 = i27(((1 as i32) << 27 - 1) - 1)
pub const MIN: i27
MIN: i27 = i27(-((1 as i32) << 27 - 1))
impl i27
[src]
impl i27
pub fn min_value() -> i27
[src]
pub fn min_value() -> i27
Returns the smallest value that can be represented by this integer type.
pub fn max_value() -> i27
[src]
pub fn max_value() -> i27
Returns the largest value that can be represented by this integer type.
pub fn new(value: i32) -> i27
[src]
pub fn new(value: i32) -> i27
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: i27) -> i27
[src]
pub fn wrapping_sub(self, rhs: i27) -> i27
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: i27) -> i27
[src]
pub fn wrapping_add(self, rhs: i27) -> i27
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 Copy for i27
impl Ord for i27
[src]
impl Ord for i27
fn cmp(&self, other: &i27) -> Ordering
[src]
fn cmp(&self, other: &i27) -> 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 i27
[src]
impl Binary for i27
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 i27
[src]
impl Debug for i27
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 i27 where
i32: ShlAssign<T>,
[src]
impl<T> ShlAssign<T> for i27 where
i32: ShlAssign<T>,
fn shl_assign(&mut self, rhs: T)
[src]
fn shl_assign(&mut self, rhs: T)
Performs the <<=
operation.
impl Default for i27
[src]
impl Default for i27
impl Display for i27
[src]
impl Display for i27
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 i27 where
i32: Shr<T>,
<i32 as Shr<T>>::Output == i32,
[src]
impl<T> Shr<T> for i27 where
i32: Shr<T>,
<i32 as Shr<T>>::Output == i32,
type Output = i27
The resulting type after applying the >>
operator.
fn shr(self, rhs: T) -> i27
[src]
fn shr(self, rhs: T) -> i27
Performs the >>
operation.
impl Clone for i27
[src]
impl Clone for i27
fn clone(&self) -> i27
[src]
fn clone(&self) -> i27
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<'a> BitOr<i27> for &'a i27
[src]
impl<'a> BitOr<i27> for &'a i27
type Output = <i27 as BitOr<i27>>::Output
The resulting type after applying the |
operator.
fn bitor(self, rhs: i27) -> <&'a i27 as BitOr<i27>>::Output
[src]
fn bitor(self, rhs: i27) -> <&'a i27 as BitOr<i27>>::Output
Performs the |
operation.
impl BitOr<i27> for i27
[src]
impl BitOr<i27> for i27
type Output = i27
The resulting type after applying the |
operator.
fn bitor(self, rhs: i27) -> <i27 as BitOr<i27>>::Output
[src]
fn bitor(self, rhs: i27) -> <i27 as BitOr<i27>>::Output
Performs the |
operation.
impl<'a> BitOr<&'a i27> for &'a i27
[src]
impl<'a> BitOr<&'a i27> for &'a i27
type Output = <i27 as BitOr<i27>>::Output
The resulting type after applying the |
operator.
fn bitor(self, rhs: &'a i27) -> <&'a i27 as BitOr<&'a i27>>::Output
[src]
fn bitor(self, rhs: &'a i27) -> <&'a i27 as BitOr<&'a i27>>::Output
Performs the |
operation.
impl<'a> BitOr<&'a i27> for i27
[src]
impl<'a> BitOr<&'a i27> for i27
type Output = <i27 as BitOr<i27>>::Output
The resulting type after applying the |
operator.
fn bitor(self, rhs: &'a i27) -> <i27 as BitOr<&'a i27>>::Output
[src]
fn bitor(self, rhs: &'a i27) -> <i27 as BitOr<&'a i27>>::Output
Performs the |
operation.
impl Hash for i27
[src]
impl Hash for i27
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<i27> for i27
[src]
impl PartialOrd<i27> for i27
fn partial_cmp(&self, other: &i27) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &i27) -> 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 i27
[src]
impl LowerHex for i27
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<i27> for i27
[src]
impl BitOrAssign<i27> for i27
fn bitor_assign(&mut self, other: i27)
[src]
fn bitor_assign(&mut self, other: i27)
Performs the |=
operation.
impl UpperHex for i27
[src]
impl UpperHex for i27
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 i27 where
i32: Shl<T>,
<i32 as Shl<T>>::Output == i32,
[src]
impl<T> Shl<T> for i27 where
i32: Shl<T>,
<i32 as Shl<T>>::Output == i32,
type Output = i27
The resulting type after applying the <<
operator.
fn shl(self, rhs: T) -> i27
[src]
fn shl(self, rhs: T) -> i27
Performs the <<
operation.
impl From<i14> for i27
[src]
impl From<i14> for i27
impl From<i27> for i37
[src]
impl From<i27> for i37
impl From<i27> for i53
[src]
impl From<i27> for i53
impl From<i27> for i28
[src]
impl From<i27> for i28
impl From<i3> for i27
[src]
impl From<i3> for i27
impl From<i10> for i27
[src]
impl From<i10> for i27
impl From<i6> for i27
[src]
impl From<i6> for i27
impl From<i27> for i50
[src]
impl From<i27> for i50
impl From<i27> for i64
[src]
impl From<i27> for i64
impl From<i27> for i63
[src]
impl From<i27> for i63
impl From<i11> for i27
[src]
impl From<i11> for i27
impl From<i27> for i33
[src]
impl From<i27> for i33
impl From<i27> for i30
[src]
impl From<i27> for i30
impl From<i9> for i27
[src]
impl From<i9> for i27
impl From<i15> for i27
[src]
impl From<i15> for i27
impl From<i27> for i55
[src]
impl From<i27> for i55
impl From<i18> for i27
[src]
impl From<i18> for i27
impl From<i23> for i27
[src]
impl From<i23> for i27
impl From<i27> for i58
[src]
impl From<i27> for i58
impl From<i27> for i45
[src]
impl From<i27> for i45
impl From<i27> for i47
[src]
impl From<i27> for i47
impl From<i5> for i27
[src]
impl From<i5> for i27
impl From<i27> for i44
[src]
impl From<i27> for i44
impl From<i27> for i61
[src]
impl From<i27> for i61
impl From<i27> for i43
[src]
impl From<i27> for i43
impl From<i27> for i38
[src]
impl From<i27> for i38
impl From<i27> for i41
[src]
impl From<i27> for i41
impl From<i19> for i27
[src]
impl From<i19> for i27
impl From<i22> for i27
[src]
impl From<i22> for i27
impl From<i24> for i27
[src]
impl From<i24> for i27
impl From<i27> for i51
[src]
impl From<i27> for i51
impl From<i27> for i52
[src]
impl From<i27> for i52
impl From<i27> for i39
[src]
impl From<i27> for i39
impl From<i27> for i32
[src]
impl From<i27> for i32
impl From<i27> for i56
[src]
impl From<i27> for i56
impl From<i27> for i62
[src]
impl From<i27> for i62
impl From<i27> for i46
[src]
impl From<i27> for i46
impl From<i27> for i36
[src]
impl From<i27> for i36
impl From<i7> for i27
[src]
impl From<i7> for i27
impl From<i27> for i54
[src]
impl From<i27> for i54
impl From<i27> for i42
[src]
impl From<i27> for i42
impl From<i27> for i60
[src]
impl From<i27> for i60
impl From<i27> for i31
[src]
impl From<i27> for i31
impl From<i27> for i40
[src]
impl From<i27> for i40
impl From<i25> for i27
[src]
impl From<i25> for i27
impl From<i21> for i27
[src]
impl From<i21> for i27
impl From<i17> for i27
[src]
impl From<i17> for i27
impl From<i27> for i29
[src]
impl From<i27> for i29
impl From<i12> for i27
[src]
impl From<i12> for i27
impl From<i27> for i59
[src]
impl From<i27> for i59
impl From<i27> for i57
[src]
impl From<i27> for i57
impl From<i4> for i27
[src]
impl From<i4> for i27
impl From<i26> for i27
[src]
impl From<i26> for i27
impl From<i27> for i35
[src]
impl From<i27> for i35
impl From<i2> for i27
[src]
impl From<i2> for i27
impl From<i20> for i27
[src]
impl From<i20> for i27
impl From<i27> for i48
[src]
impl From<i27> for i48
impl From<i8> for i27
[src]
impl From<i8> for i27
impl From<i27> for i34
[src]
impl From<i27> for i34
impl From<i16> for i27
[src]
impl From<i16> for i27
impl From<i27> for i49
[src]
impl From<i27> for i49
impl From<i13> for i27
[src]
impl From<i13> for i27
impl PartialEq<i27> for i27
[src]
impl PartialEq<i27> for i27
fn eq(&self, other: &i27) -> bool
[src]
fn eq(&self, other: &i27) -> 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 i27 where
i32: ShrAssign<T>,
[src]
impl<T> ShrAssign<T> for i27 where
i32: ShrAssign<T>,
fn shr_assign(&mut self, rhs: T)
[src]
fn shr_assign(&mut self, rhs: T)
Performs the >>=
operation.
impl Octal for i27
[src]
impl Octal for i27
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 i27
[src]
impl Eq for i27
impl Serializable for i27
[src]
impl Serializable for i27
const BIT_LENGTH_MIN: usize
BIT_LENGTH_MIN: usize = 27
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