pub struct Signed6Bit {
pub(crate) bits: u8,
}
Expand description
Signed6Bit
is somewhat special-purpose as the signed counterpart
for Unsigned6Bit
, which is for handlng index register numbers and
sequence numbers.
Fields§
§bits: u8
Implementations§
Source§impl Signed6Bit
impl Signed6Bit
const SIGN_BIT: u8 = 32u8
const VALUE_BITS: u8 = 31u8
const ALL_BITS: u8 = 63u8
pub const MAX: Self
pub const MIN: Self
pub const ZERO: Self
pub const MINUS_ZERO: Self
pub const ONE: Self
pub const fn is_positive_zero(&self) -> bool
pub const fn is_negative_zero(&self) -> bool
pub const fn is_zero(&self) -> bool
pub const fn reinterpret_as_unsigned(&self) -> Unsigned6Bit
pub const fn is_negative(&self) -> bool
pub const fn is_positive(&self) -> bool
pub const fn convert_to_ones_complement(signed: i8) -> u8
pub fn checked_add(self, rhs: Signed6Bit) -> Option<Signed6Bit>
pub fn checked_sub(self, rhs: Signed6Bit) -> Option<Signed6Bit>
pub fn wrapping_add(self, rhs: Signed6Bit) -> Signed6Bit
pub fn wrapping_sub(self, rhs: Signed6Bit) -> Signed6Bit
pub fn checked_div(self, rhs: Signed6Bit) -> Option<Signed6Bit>
pub const fn abs(self) -> Self
pub const fn overflowing_abs(self) -> (Self, bool)
Trait Implementations§
Source§impl Clone for Signed6Bit
impl Clone for Signed6Bit
Source§fn clone(&self) -> Signed6Bit
fn clone(&self) -> Signed6Bit
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 Signed6Bit
impl Debug for Signed6Bit
Source§impl Default for Signed6Bit
impl Default for Signed6Bit
Source§impl From<Signed6Bit> for Signed18Bit
impl From<Signed6Bit> for Signed18Bit
Source§fn from(n: Signed6Bit) -> Self
fn from(n: Signed6Bit) -> Self
Converts to this type from the input type.
Source§impl From<Signed6Bit> for i16
impl From<Signed6Bit> for i16
Source§fn from(n: Signed6Bit) -> i16
fn from(n: Signed6Bit) -> i16
Converts to this type from the input type.
Source§impl From<Signed6Bit> for i32
impl From<Signed6Bit> for i32
Source§fn from(n: Signed6Bit) -> i32
fn from(n: Signed6Bit) -> i32
Converts to this type from the input type.
Source§impl From<Signed6Bit> for i64
impl From<Signed6Bit> for i64
Source§fn from(n: Signed6Bit) -> i64
fn from(n: Signed6Bit) -> i64
Converts to this type from the input type.
Source§impl From<Signed6Bit> for i8
impl From<Signed6Bit> for i8
Source§fn from(n: Signed6Bit) -> i8
fn from(n: Signed6Bit) -> i8
Converts to this type from the input type.
Source§impl From<Signed6Bit> for isize
impl From<Signed6Bit> for isize
Source§fn from(n: Signed6Bit) -> isize
fn from(n: Signed6Bit) -> isize
Converts to this type from the input type.
Source§impl Hash for Signed6Bit
impl Hash for Signed6Bit
Source§impl IndexBy<Signed6Bit> for Address
impl IndexBy<Signed6Bit> for Address
fn index_by(&self, delta: Signed6Bit) -> Address
Source§impl Octal for Signed6Bit
impl Octal for Signed6Bit
Source§impl Ord for Signed6Bit
impl Ord for Signed6Bit
Source§fn cmp(&self, other: &Signed6Bit) -> Ordering
fn cmp(&self, other: &Signed6Bit) -> 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 PartialEq<i8> for Signed6Bit
impl PartialEq<i8> for Signed6Bit
Source§impl PartialEq for Signed6Bit
impl PartialEq for Signed6Bit
Source§impl PartialOrd<i8> for Signed6Bit
impl PartialOrd<i8> for Signed6Bit
Source§impl PartialOrd for Signed6Bit
impl PartialOrd for Signed6Bit
Source§impl TryFrom<Signed6Bit> for u16
impl TryFrom<Signed6Bit> for u16
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Signed6Bit) -> Result<u16, ConversionFailed>
fn try_from(n: Signed6Bit) -> Result<u16, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<Signed6Bit> for u32
impl TryFrom<Signed6Bit> for u32
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Signed6Bit) -> Result<u32, ConversionFailed>
fn try_from(n: Signed6Bit) -> Result<u32, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<Signed6Bit> for u64
impl TryFrom<Signed6Bit> for u64
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Signed6Bit) -> Result<u64, ConversionFailed>
fn try_from(n: Signed6Bit) -> Result<u64, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<Signed6Bit> for u8
impl TryFrom<Signed6Bit> for u8
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Signed6Bit) -> Result<u8, ConversionFailed>
fn try_from(n: Signed6Bit) -> Result<u8, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<Signed6Bit> for usize
impl TryFrom<Signed6Bit> for usize
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Signed6Bit) -> Result<usize, ConversionFailed>
fn try_from(n: Signed6Bit) -> Result<usize, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<i16> for Signed6Bit
impl TryFrom<i16> for Signed6Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: i16) -> Result<Signed6Bit, ConversionFailed>
fn try_from(n: i16) -> Result<Signed6Bit, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<i32> for Signed6Bit
impl TryFrom<i32> for Signed6Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: i32) -> Result<Signed6Bit, ConversionFailed>
fn try_from(n: i32) -> Result<Signed6Bit, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<i64> for Signed6Bit
impl TryFrom<i64> for Signed6Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: i64) -> Result<Signed6Bit, ConversionFailed>
fn try_from(n: i64) -> Result<Signed6Bit, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<i8> for Signed6Bit
impl TryFrom<i8> for Signed6Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: i8) -> Result<Signed6Bit, ConversionFailed>
fn try_from(n: i8) -> Result<Signed6Bit, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<isize> for Signed6Bit
impl TryFrom<isize> for Signed6Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: isize) -> Result<Signed6Bit, ConversionFailed>
fn try_from(n: isize) -> Result<Signed6Bit, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<u16> for Signed6Bit
impl TryFrom<u16> for Signed6Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: u16) -> Result<Signed6Bit, ConversionFailed>
fn try_from(n: u16) -> Result<Signed6Bit, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<u32> for Signed6Bit
impl TryFrom<u32> for Signed6Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: u32) -> Result<Signed6Bit, ConversionFailed>
fn try_from(n: u32) -> Result<Signed6Bit, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<u64> for Signed6Bit
impl TryFrom<u64> for Signed6Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: u64) -> Result<Signed6Bit, ConversionFailed>
fn try_from(n: u64) -> Result<Signed6Bit, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<u8> for Signed6Bit
impl TryFrom<u8> for Signed6Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: u8) -> Result<Signed6Bit, ConversionFailed>
fn try_from(n: u8) -> Result<Signed6Bit, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<usize> for Signed6Bit
impl TryFrom<usize> for Signed6Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: usize) -> Result<Signed6Bit, ConversionFailed>
fn try_from(n: usize) -> Result<Signed6Bit, ConversionFailed>
Performs the conversion.
Source§impl WordCommon for Signed6Bit
impl WordCommon for Signed6Bit
impl Copy for Signed6Bit
impl Eq for Signed6Bit
Auto Trait Implementations§
impl Freeze for Signed6Bit
impl RefUnwindSafe for Signed6Bit
impl Send for Signed6Bit
impl Sync for Signed6Bit
impl Unpin for Signed6Bit
impl UnwindSafe for Signed6Bit
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.