pub struct Unsigned5Bit {
pub(crate) bits: u8,
}
Expand description
Unsigned5Bit
is used as a system configuration value; that is,
an index into F-memory.
Fields§
§bits: u8
Implementations§
Source§impl Unsigned5Bit
impl Unsigned5Bit
const MODULUS: u8 = 32u8
const VALUE_BITS: u8 = 31u8
pub const MAX: Self
pub const ZERO: Self
pub const ONE: Self
pub const MIN: Self = Self::ZERO
pub const fn new<const N: u8>() -> Unsigned5Bit
pub const fn is_zero(&self) -> bool
pub const fn is_negative(&self) -> bool
pub const fn is_positive(&self) -> bool
pub const fn reinterpret_as_signed(&self) -> Signed5Bit
pub fn wrapping_add(self, rhs: Unsigned5Bit) -> Unsigned5Bit
pub fn wrapping_sub(self, rhs: Unsigned5Bit) -> Unsigned5Bit
pub fn checked_add(self, rhs: Unsigned5Bit) -> Option<Unsigned5Bit>
pub fn checked_sub(self, rhs: Unsigned5Bit) -> Option<Unsigned5Bit>
pub fn wrapping_mul(self, rhs: Unsigned5Bit) -> Unsigned5Bit
pub fn checked_mul(self, rhs: Unsigned5Bit) -> Option<Unsigned5Bit>
pub fn checked_div(self, rhs: Unsigned5Bit) -> Option<Unsigned5Bit>
pub const fn abs(self) -> Self
pub const fn overflowing_abs(self) -> (Self, bool)
pub const fn and(self, mask: u8) -> Self
pub const fn bitor(self, mask: u8) -> Self
Trait Implementations§
Source§impl BitAnd<u8> for Unsigned5Bit
impl BitAnd<u8> for Unsigned5Bit
Source§impl BitAnd for Unsigned5Bit
impl BitAnd for Unsigned5Bit
Source§impl BitOr<u8> for Unsigned5Bit
impl BitOr<u8> for Unsigned5Bit
Source§impl BitOr for Unsigned5Bit
impl BitOr for Unsigned5Bit
Source§impl BitXor<u8> for Unsigned5Bit
impl BitXor<u8> for Unsigned5Bit
Source§impl BitXor for Unsigned5Bit
impl BitXor for Unsigned5Bit
Source§impl Clone for Unsigned5Bit
impl Clone for Unsigned5Bit
Source§fn clone(&self) -> Unsigned5Bit
fn clone(&self) -> Unsigned5Bit
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Unsigned5Bit
impl Debug for Unsigned5Bit
Source§impl Default for Unsigned5Bit
impl Default for Unsigned5Bit
Source§impl Display for Unsigned5Bit
impl Display for Unsigned5Bit
Source§impl From<Unsigned5Bit> for Unsigned12Bit
impl From<Unsigned5Bit> for Unsigned12Bit
Source§fn from(n: Unsigned5Bit) -> Self
fn from(n: Unsigned5Bit) -> Self
Converts to this type from the input type.
Source§impl From<Unsigned5Bit> for Unsigned18Bit
impl From<Unsigned5Bit> for Unsigned18Bit
Source§fn from(n: Unsigned5Bit) -> Self
fn from(n: Unsigned5Bit) -> Self
Converts to this type from the input type.
Source§impl From<Unsigned5Bit> for Unsigned36Bit
impl From<Unsigned5Bit> for Unsigned36Bit
Source§fn from(n: Unsigned5Bit) -> Self
fn from(n: Unsigned5Bit) -> Self
Converts to this type from the input type.
Source§impl From<Unsigned5Bit> for Unsigned6Bit
impl From<Unsigned5Bit> for Unsigned6Bit
Source§fn from(n: Unsigned5Bit) -> Self
fn from(n: Unsigned5Bit) -> Self
Converts to this type from the input type.
Source§impl From<Unsigned5Bit> for Unsigned9Bit
impl From<Unsigned5Bit> for Unsigned9Bit
Source§fn from(n: Unsigned5Bit) -> Self
fn from(n: Unsigned5Bit) -> Self
Converts to this type from the input type.
Source§impl From<Unsigned5Bit> for i16
impl From<Unsigned5Bit> for i16
Source§fn from(n: Unsigned5Bit) -> i16
fn from(n: Unsigned5Bit) -> i16
Converts to this type from the input type.
Source§impl From<Unsigned5Bit> for i32
impl From<Unsigned5Bit> for i32
Source§fn from(n: Unsigned5Bit) -> i32
fn from(n: Unsigned5Bit) -> i32
Converts to this type from the input type.
Source§impl From<Unsigned5Bit> for i64
impl From<Unsigned5Bit> for i64
Source§fn from(n: Unsigned5Bit) -> i64
fn from(n: Unsigned5Bit) -> i64
Converts to this type from the input type.
Source§impl From<Unsigned5Bit> for i8
impl From<Unsigned5Bit> for i8
Source§fn from(n: Unsigned5Bit) -> i8
fn from(n: Unsigned5Bit) -> i8
Converts to this type from the input type.
Source§impl From<Unsigned5Bit> for isize
impl From<Unsigned5Bit> for isize
Source§fn from(n: Unsigned5Bit) -> isize
fn from(n: Unsigned5Bit) -> isize
Converts to this type from the input type.
Source§impl From<Unsigned5Bit> for u16
impl From<Unsigned5Bit> for u16
Source§fn from(n: Unsigned5Bit) -> u16
fn from(n: Unsigned5Bit) -> u16
Converts to this type from the input type.
Source§impl From<Unsigned5Bit> for u32
impl From<Unsigned5Bit> for u32
Source§fn from(n: Unsigned5Bit) -> u32
fn from(n: Unsigned5Bit) -> u32
Converts to this type from the input type.
Source§impl From<Unsigned5Bit> for u64
impl From<Unsigned5Bit> for u64
Source§fn from(n: Unsigned5Bit) -> u64
fn from(n: Unsigned5Bit) -> u64
Converts to this type from the input type.
Source§impl From<Unsigned5Bit> for u8
impl From<Unsigned5Bit> for u8
Source§fn from(n: Unsigned5Bit) -> u8
fn from(n: Unsigned5Bit) -> u8
Converts to this type from the input type.
Source§impl From<Unsigned5Bit> for usize
impl From<Unsigned5Bit> for usize
Source§fn from(n: Unsigned5Bit) -> usize
fn from(n: Unsigned5Bit) -> usize
Converts to this type from the input type.
Source§impl Hash for Unsigned5Bit
impl Hash for Unsigned5Bit
Source§impl Not for Unsigned5Bit
impl Not for Unsigned5Bit
Source§impl Octal for Unsigned5Bit
impl Octal for Unsigned5Bit
Source§impl Ord for Unsigned5Bit
impl Ord for Unsigned5Bit
Source§fn cmp(&self, other: &Unsigned5Bit) -> Ordering
fn cmp(&self, other: &Unsigned5Bit) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T> PartialEq<T> for Unsigned5Bit
impl<T> PartialEq<T> for Unsigned5Bit
Source§impl PartialOrd<u32> for Unsigned5Bit
impl PartialOrd<u32> for Unsigned5Bit
Source§impl PartialOrd<u64> for Unsigned5Bit
impl PartialOrd<u64> for Unsigned5Bit
Source§impl PartialOrd for Unsigned5Bit
impl PartialOrd for Unsigned5Bit
Source§impl Serialize for Unsigned5Bit
impl Serialize for Unsigned5Bit
Source§impl Shl<u32> for Unsigned5Bit
impl Shl<u32> for Unsigned5Bit
Source§impl Shl for Unsigned5Bit
impl Shl for Unsigned5Bit
Source§type Output = Unsigned5Bit
type Output = Unsigned5Bit
The resulting type after applying the
<<
operator.Source§fn shl(self, shift_by: Unsigned5Bit) -> Self
fn shl(self, shift_by: Unsigned5Bit) -> Self
Performs the
<<
operation. Read moreSource§impl Shr<u32> for Unsigned5Bit
impl Shr<u32> for Unsigned5Bit
Source§impl Shr for Unsigned5Bit
impl Shr for Unsigned5Bit
Source§impl Sum for Unsigned5Bit
impl Sum for Unsigned5Bit
Source§impl TryFrom<i16> for Unsigned5Bit
impl TryFrom<i16> for Unsigned5Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<i32> for Unsigned5Bit
impl TryFrom<i32> for Unsigned5Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<i64> for Unsigned5Bit
impl TryFrom<i64> for Unsigned5Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<i8> for Unsigned5Bit
impl TryFrom<i8> for Unsigned5Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<isize> for Unsigned5Bit
impl TryFrom<isize> for Unsigned5Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<u16> for Unsigned5Bit
impl TryFrom<u16> for Unsigned5Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<u32> for Unsigned5Bit
impl TryFrom<u32> for Unsigned5Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<u64> for Unsigned5Bit
impl TryFrom<u64> for Unsigned5Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<u8> for Unsigned5Bit
impl TryFrom<u8> for Unsigned5Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<usize> for Unsigned5Bit
impl TryFrom<usize> for Unsigned5Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl WordCommon for Unsigned5Bit
impl WordCommon for Unsigned5Bit
impl Copy for Unsigned5Bit
impl Eq for Unsigned5Bit
Auto Trait Implementations§
impl Freeze for Unsigned5Bit
impl RefUnwindSafe for Unsigned5Bit
impl Send for Unsigned5Bit
impl Sync for Unsigned5Bit
impl Unpin for Unsigned5Bit
impl UnwindSafe for Unsigned5Bit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.