[−][src]Struct ux::u7
The 7-bit unsigned integer type.
Methods
impl u7
[src]
impl u7
impl u7
[src]
impl u7
pub fn min_value() -> u7
[src]
pub fn min_value() -> u7
Returns the smallest value that can be represented by this integer type.
pub fn max_value() -> u7
[src]
pub fn max_value() -> u7
Returns the largest value that can be represented by this integer type.
pub fn new(value: u8) -> u7
[src]
pub fn new(value: u8) -> u7
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: Self) -> Self
[src]
pub fn wrapping_sub(self, rhs: Self) -> Self
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: Self) -> Self
[src]
pub fn wrapping_add(self, rhs: Self) -> Self
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 Clone for u7
[src]
impl Clone for u7
fn clone(&self) -> u7
[src]
fn clone(&self) -> u7
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 Copy for u7
[src]
impl Copy for u7
impl From<u7> for u8
[src]
impl From<u7> for u8
impl From<u7> for u16
[src]
impl From<u7> for u16
impl From<u7> for u32
[src]
impl From<u7> for u32
impl From<u7> for u64
[src]
impl From<u7> for u64
impl From<u2> for u7
[src]
impl From<u2> for u7
impl From<u3> for u7
[src]
impl From<u3> for u7
impl From<u4> for u7
[src]
impl From<u4> for u7
impl From<u5> for u7
[src]
impl From<u5> for u7
impl From<u6> for u7
[src]
impl From<u6> for u7
impl From<u7> for u9
[src]
impl From<u7> for u9
impl From<u7> for u10
[src]
impl From<u7> for u10
impl From<u7> for u11
[src]
impl From<u7> for u11
impl From<u7> for u12
[src]
impl From<u7> for u12
impl From<u7> for u13
[src]
impl From<u7> for u13
impl From<u7> for u14
[src]
impl From<u7> for u14
impl From<u7> for u15
[src]
impl From<u7> for u15
impl From<u7> for u17
[src]
impl From<u7> for u17
impl From<u7> for u18
[src]
impl From<u7> for u18
impl From<u7> for u19
[src]
impl From<u7> for u19
impl From<u7> for u20
[src]
impl From<u7> for u20
impl From<u7> for u21
[src]
impl From<u7> for u21
impl From<u7> for u22
[src]
impl From<u7> for u22
impl From<u7> for u23
[src]
impl From<u7> for u23
impl From<u7> for u24
[src]
impl From<u7> for u24
impl From<u7> for u25
[src]
impl From<u7> for u25
impl From<u7> for u26
[src]
impl From<u7> for u26
impl From<u7> for u27
[src]
impl From<u7> for u27
impl From<u7> for u28
[src]
impl From<u7> for u28
impl From<u7> for u29
[src]
impl From<u7> for u29
impl From<u7> for u30
[src]
impl From<u7> for u30
impl From<u7> for u31
[src]
impl From<u7> for u31
impl From<u7> for u33
[src]
impl From<u7> for u33
impl From<u7> for u34
[src]
impl From<u7> for u34
impl From<u7> for u35
[src]
impl From<u7> for u35
impl From<u7> for u36
[src]
impl From<u7> for u36
impl From<u7> for u37
[src]
impl From<u7> for u37
impl From<u7> for u38
[src]
impl From<u7> for u38
impl From<u7> for u39
[src]
impl From<u7> for u39
impl From<u7> for u40
[src]
impl From<u7> for u40
impl From<u7> for u41
[src]
impl From<u7> for u41
impl From<u7> for u42
[src]
impl From<u7> for u42
impl From<u7> for u43
[src]
impl From<u7> for u43
impl From<u7> for u44
[src]
impl From<u7> for u44
impl From<u7> for u45
[src]
impl From<u7> for u45
impl From<u7> for u46
[src]
impl From<u7> for u46
impl From<u7> for u47
[src]
impl From<u7> for u47
impl From<u7> for u48
[src]
impl From<u7> for u48
impl From<u7> for u49
[src]
impl From<u7> for u49
impl From<u7> for u50
[src]
impl From<u7> for u50
impl From<u7> for u51
[src]
impl From<u7> for u51
impl From<u7> for u52
[src]
impl From<u7> for u52
impl From<u7> for u53
[src]
impl From<u7> for u53
impl From<u7> for u54
[src]
impl From<u7> for u54
impl From<u7> for u55
[src]
impl From<u7> for u55
impl From<u7> for u56
[src]
impl From<u7> for u56
impl From<u7> for u57
[src]
impl From<u7> for u57
impl From<u7> for u58
[src]
impl From<u7> for u58
impl From<u7> for u59
[src]
impl From<u7> for u59
impl From<u7> for u60
[src]
impl From<u7> for u60
impl From<u7> for u61
[src]
impl From<u7> for u61
impl From<u7> for u62
[src]
impl From<u7> for u62
impl From<u7> for u63
[src]
impl From<u7> for u63
impl Eq for u7
[src]
impl Eq for u7
impl PartialOrd<u7> for u7
[src]
impl PartialOrd<u7> for u7
fn partial_cmp(&self, other: &u7) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &u7) -> Option<Ordering>
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
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
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
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 Default for u7
[src]
impl Default for u7
impl PartialEq<u7> for u7
[src]
impl PartialEq<u7> for u7
fn eq(&self, other: &Self) -> bool
[src]
fn eq(&self, other: &Self) -> bool
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Ord for u7
[src]
impl Ord for u7
fn cmp(&self, other: &u7) -> Ordering
[src]
fn cmp(&self, other: &u7) -> Ordering
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 Display for u7
[src]
impl Display for u7
impl Debug for u7
[src]
impl Debug for u7
impl Add<u7> for u7
[src]
impl Add<u7> for u7
type Output = u7
The resulting type after applying the +
operator.
fn add(self, other: u7) -> u7
[src]
fn add(self, other: u7) -> u7
impl Sub<u7> for u7
[src]
impl Sub<u7> for u7
type Output = u7
The resulting type after applying the -
operator.
fn sub(self, other: u7) -> u7
[src]
fn sub(self, other: u7) -> u7
impl Not for u7
[src]
impl Not for u7
impl<'a> Not for &'a u7
[src]
impl<'a> Not for &'a u7
type Output = <u7 as Not>::Output
The resulting type after applying the !
operator.
fn not(self) -> u7
[src]
fn not(self) -> u7
impl BitAnd<u7> for u7
[src]
impl BitAnd<u7> for u7
type Output = u7
The resulting type after applying the &
operator.
fn bitand(self, rhs: u7) -> Self::Output
[src]
fn bitand(self, rhs: u7) -> Self::Output
impl<'a> BitAnd<&'a u7> for u7
[src]
impl<'a> BitAnd<&'a u7> for u7
type Output = <u7 as BitOr<u7>>::Output
The resulting type after applying the &
operator.
fn bitand(self, rhs: &'a u7) -> Self::Output
[src]
fn bitand(self, rhs: &'a u7) -> Self::Output
impl<'a> BitAnd<u7> for &'a u7
[src]
impl<'a> BitAnd<u7> for &'a u7
type Output = <u7 as BitOr<u7>>::Output
The resulting type after applying the &
operator.
fn bitand(self, rhs: u7) -> Self::Output
[src]
fn bitand(self, rhs: u7) -> Self::Output
impl<'a> BitAnd<&'a u7> for &'a u7
[src]
impl<'a> BitAnd<&'a u7> for &'a u7
type Output = <u7 as BitOr<u7>>::Output
The resulting type after applying the &
operator.
fn bitand(self, rhs: &'a u7) -> Self::Output
[src]
fn bitand(self, rhs: &'a u7) -> Self::Output
impl BitOr<u7> for u7
[src]
impl BitOr<u7> for u7
type Output = u7
The resulting type after applying the |
operator.
fn bitor(self, rhs: u7) -> Self::Output
[src]
fn bitor(self, rhs: u7) -> Self::Output
impl<'a> BitOr<&'a u7> for u7
[src]
impl<'a> BitOr<&'a u7> for u7
type Output = <u7 as BitOr<u7>>::Output
The resulting type after applying the |
operator.
fn bitor(self, rhs: &'a u7) -> Self::Output
[src]
fn bitor(self, rhs: &'a u7) -> Self::Output
impl<'a> BitOr<u7> for &'a u7
[src]
impl<'a> BitOr<u7> for &'a u7
type Output = <u7 as BitOr<u7>>::Output
The resulting type after applying the |
operator.
fn bitor(self, rhs: u7) -> Self::Output
[src]
fn bitor(self, rhs: u7) -> Self::Output
impl<'a> BitOr<&'a u7> for &'a u7
[src]
impl<'a> BitOr<&'a u7> for &'a u7
type Output = <u7 as BitOr<u7>>::Output
The resulting type after applying the |
operator.
fn bitor(self, rhs: &'a u7) -> Self::Output
[src]
fn bitor(self, rhs: &'a u7) -> Self::Output
impl BitXor<u7> for u7
[src]
impl BitXor<u7> for u7
type Output = u7
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: u7) -> Self::Output
[src]
fn bitxor(self, rhs: u7) -> Self::Output
impl<'a> BitXor<&'a u7> for u7
[src]
impl<'a> BitXor<&'a u7> for u7
type Output = <u7 as BitOr<u7>>::Output
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: &'a u7) -> Self::Output
[src]
fn bitxor(self, rhs: &'a u7) -> Self::Output
impl<'a> BitXor<u7> for &'a u7
[src]
impl<'a> BitXor<u7> for &'a u7
type Output = <u7 as BitOr<u7>>::Output
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: u7) -> Self::Output
[src]
fn bitxor(self, rhs: u7) -> Self::Output
impl<'a> BitXor<&'a u7> for &'a u7
[src]
impl<'a> BitXor<&'a u7> for &'a u7
type Output = <u7 as BitOr<u7>>::Output
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: &'a u7) -> Self::Output
[src]
fn bitxor(self, rhs: &'a u7) -> Self::Output
impl<T> Shl<T> for u7 where
u8: Shl<T, Output = u8>,
[src]
impl<T> Shl<T> for u7 where
u8: Shl<T, Output = u8>,
impl<T> Shr<T> for u7 where
u8: Shr<T, Output = u8>,
[src]
impl<T> Shr<T> for u7 where
u8: Shr<T, Output = u8>,
impl BitAndAssign<u7> for u7
[src]
impl BitAndAssign<u7> for u7
fn bitand_assign(&mut self, other: u7)
[src]
fn bitand_assign(&mut self, other: u7)
impl BitOrAssign<u7> for u7
[src]
impl BitOrAssign<u7> for u7
fn bitor_assign(&mut self, other: u7)
[src]
fn bitor_assign(&mut self, other: u7)
impl BitXorAssign<u7> for u7
[src]
impl BitXorAssign<u7> for u7
fn bitxor_assign(&mut self, other: u7)
[src]
fn bitxor_assign(&mut self, other: u7)
impl<T> ShlAssign<T> for u7 where
u8: ShlAssign<T>,
[src]
impl<T> ShlAssign<T> for u7 where
u8: ShlAssign<T>,
fn shl_assign(&mut self, rhs: T)
[src]
fn shl_assign(&mut self, rhs: T)
impl<T> ShrAssign<T> for u7 where
u8: ShrAssign<T>,
[src]
impl<T> ShrAssign<T> for u7 where
u8: ShrAssign<T>,
fn shr_assign(&mut self, rhs: T)
[src]
fn shr_assign(&mut self, rhs: T)
impl Hash for u7
[src]
impl Hash for u7
fn hash<H: Hasher>(&self, h: &mut H)
[src]
fn hash<H: Hasher>(&self, h: &mut H)
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 Octal for u7
[src]
impl Octal for u7
impl Binary for u7
[src]
impl Binary for u7
impl LowerHex for u7
[src]
impl LowerHex for u7
impl UpperHex for u7
[src]
impl UpperHex for u7
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
impl<T> ToString for T where
T: Display + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
ⓘImportant traits for &'a mut Wfn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T