pub struct Unsigned9Bit {
pub(crate) bits: u16,
}
Expand description
Unsigned9Bit
is the value of a “quarter” of the 36-bit TX-2
machine word. A number of instructions - and in particular the
Exchange Unit - work on the quarters of a word.
Fields§
§bits: u16
Implementations§
Source§impl Unsigned9Bit
impl Unsigned9Bit
const MODULUS: u16 = 512u16
const VALUE_BITS: u16 = 511u16
pub const MAX: Self
pub const ZERO: Self
pub const ONE: Self
pub const MIN: Self = Self::ZERO
pub const fn new<const N: u16>() -> Unsigned9Bit
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) -> Signed9Bit
pub fn wrapping_add(self, rhs: Unsigned9Bit) -> Unsigned9Bit
pub fn wrapping_sub(self, rhs: Unsigned9Bit) -> Unsigned9Bit
pub fn checked_add(self, rhs: Unsigned9Bit) -> Option<Unsigned9Bit>
pub fn checked_sub(self, rhs: Unsigned9Bit) -> Option<Unsigned9Bit>
pub fn wrapping_mul(self, rhs: Unsigned9Bit) -> Unsigned9Bit
pub fn checked_mul(self, rhs: Unsigned9Bit) -> Option<Unsigned9Bit>
pub fn checked_div(self, rhs: Unsigned9Bit) -> Option<Unsigned9Bit>
pub const fn abs(self) -> Self
pub const fn overflowing_abs(self) -> (Self, bool)
pub const fn and(self, mask: u16) -> Self
pub const fn bitor(self, mask: u16) -> Self
Trait Implementations§
Source§impl BitAnd<Unsigned9Bit> for Unsigned36Bit
impl BitAnd<Unsigned9Bit> for Unsigned36Bit
Source§type Output = Unsigned9Bit
type Output = Unsigned9Bit
The resulting type after applying the
&
operator.Source§fn bitand(self, rhs: Unsigned9Bit) -> Unsigned9Bit
fn bitand(self, rhs: Unsigned9Bit) -> Unsigned9Bit
Performs the
&
operation. Read moreSource§impl BitAnd<u16> for Unsigned9Bit
impl BitAnd<u16> for Unsigned9Bit
Source§impl BitAnd for Unsigned9Bit
impl BitAnd for Unsigned9Bit
Source§impl BitOr<u16> for Unsigned9Bit
impl BitOr<u16> for Unsigned9Bit
Source§impl BitOr for Unsigned9Bit
impl BitOr for Unsigned9Bit
Source§impl BitXor<u16> for Unsigned9Bit
impl BitXor<u16> for Unsigned9Bit
Source§impl BitXor for Unsigned9Bit
impl BitXor for Unsigned9Bit
Source§impl Clone for Unsigned9Bit
impl Clone for Unsigned9Bit
Source§fn clone(&self) -> Unsigned9Bit
fn clone(&self) -> Unsigned9Bit
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 Unsigned9Bit
impl Debug for Unsigned9Bit
Source§impl Default for Unsigned9Bit
impl Default for Unsigned9Bit
Source§impl Display for Unsigned9Bit
impl Display for Unsigned9Bit
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<Unsigned6Bit> for Unsigned9Bit
impl From<Unsigned6Bit> for Unsigned9Bit
Source§fn from(n: Unsigned6Bit) -> Self
fn from(n: Unsigned6Bit) -> Self
Converts to this type from the input type.
Source§impl From<Unsigned9Bit> for Unsigned12Bit
impl From<Unsigned9Bit> for Unsigned12Bit
Source§fn from(n: Unsigned9Bit) -> Self
fn from(n: Unsigned9Bit) -> Self
Converts to this type from the input type.
Source§impl From<Unsigned9Bit> for Unsigned18Bit
impl From<Unsigned9Bit> for Unsigned18Bit
Source§fn from(n: Unsigned9Bit) -> Self
fn from(n: Unsigned9Bit) -> Self
Converts to this type from the input type.
Source§impl From<Unsigned9Bit> for Unsigned36Bit
impl From<Unsigned9Bit> for Unsigned36Bit
Source§fn from(n: Unsigned9Bit) -> Self
fn from(n: Unsigned9Bit) -> Self
Converts to this type from the input type.
Source§impl From<Unsigned9Bit> for i16
impl From<Unsigned9Bit> for i16
Source§fn from(n: Unsigned9Bit) -> i16
fn from(n: Unsigned9Bit) -> i16
Converts to this type from the input type.
Source§impl From<Unsigned9Bit> for i32
impl From<Unsigned9Bit> for i32
Source§fn from(n: Unsigned9Bit) -> i32
fn from(n: Unsigned9Bit) -> i32
Converts to this type from the input type.
Source§impl From<Unsigned9Bit> for i64
impl From<Unsigned9Bit> for i64
Source§fn from(n: Unsigned9Bit) -> i64
fn from(n: Unsigned9Bit) -> i64
Converts to this type from the input type.
Source§impl From<Unsigned9Bit> for isize
impl From<Unsigned9Bit> for isize
Source§fn from(n: Unsigned9Bit) -> isize
fn from(n: Unsigned9Bit) -> isize
Converts to this type from the input type.
Source§impl From<Unsigned9Bit> for u16
impl From<Unsigned9Bit> for u16
Source§fn from(n: Unsigned9Bit) -> u16
fn from(n: Unsigned9Bit) -> u16
Converts to this type from the input type.
Source§impl From<Unsigned9Bit> for u32
impl From<Unsigned9Bit> for u32
Source§fn from(n: Unsigned9Bit) -> u32
fn from(n: Unsigned9Bit) -> u32
Converts to this type from the input type.
Source§impl From<Unsigned9Bit> for u64
impl From<Unsigned9Bit> for u64
Source§fn from(n: Unsigned9Bit) -> u64
fn from(n: Unsigned9Bit) -> u64
Converts to this type from the input type.
Source§impl From<Unsigned9Bit> for usize
impl From<Unsigned9Bit> for usize
Source§fn from(n: Unsigned9Bit) -> usize
fn from(n: Unsigned9Bit) -> usize
Converts to this type from the input type.
Source§impl From<u8> for Unsigned9Bit
impl From<u8> for Unsigned9Bit
Source§impl Hash for Unsigned9Bit
impl Hash for Unsigned9Bit
Source§impl Not for Unsigned9Bit
impl Not for Unsigned9Bit
Source§impl Octal for Unsigned9Bit
impl Octal for Unsigned9Bit
Source§impl Ord for Unsigned9Bit
impl Ord for Unsigned9Bit
Source§fn cmp(&self, other: &Unsigned9Bit) -> Ordering
fn cmp(&self, other: &Unsigned9Bit) -> 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 Unsigned9Bit
impl<T> PartialEq<T> for Unsigned9Bit
Source§impl PartialOrd<u32> for Unsigned9Bit
impl PartialOrd<u32> for Unsigned9Bit
Source§impl PartialOrd<u64> for Unsigned9Bit
impl PartialOrd<u64> for Unsigned9Bit
Source§impl PartialOrd for Unsigned9Bit
impl PartialOrd for Unsigned9Bit
Source§impl Serialize for Unsigned9Bit
impl Serialize for Unsigned9Bit
Source§impl Shl<u32> for Unsigned9Bit
impl Shl<u32> for Unsigned9Bit
Source§impl Shl for Unsigned9Bit
impl Shl for Unsigned9Bit
Source§type Output = Unsigned9Bit
type Output = Unsigned9Bit
The resulting type after applying the
<<
operator.Source§fn shl(self, shift_by: Unsigned9Bit) -> Self
fn shl(self, shift_by: Unsigned9Bit) -> Self
Performs the
<<
operation. Read moreSource§impl Shr<u32> for Unsigned9Bit
impl Shr<u32> for Unsigned9Bit
Source§impl Shr for Unsigned9Bit
impl Shr for Unsigned9Bit
Source§impl Sum for Unsigned9Bit
impl Sum for Unsigned9Bit
Source§impl TryFrom<Unsigned9Bit> for i8
impl TryFrom<Unsigned9Bit> for i8
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Unsigned9Bit) -> Result<i8, ConversionFailed>
fn try_from(n: Unsigned9Bit) -> Result<i8, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<Unsigned9Bit> for u8
impl TryFrom<Unsigned9Bit> for u8
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Unsigned9Bit) -> Result<u8, ConversionFailed>
fn try_from(n: Unsigned9Bit) -> Result<u8, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<i16> for Unsigned9Bit
impl TryFrom<i16> for Unsigned9Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<i32> for Unsigned9Bit
impl TryFrom<i32> for Unsigned9Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<i64> for Unsigned9Bit
impl TryFrom<i64> for Unsigned9Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<i8> for Unsigned9Bit
impl TryFrom<i8> for Unsigned9Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<isize> for Unsigned9Bit
impl TryFrom<isize> for Unsigned9Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<u16> for Unsigned9Bit
impl TryFrom<u16> for Unsigned9Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<u32> for Unsigned9Bit
impl TryFrom<u32> for Unsigned9Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<u64> for Unsigned9Bit
impl TryFrom<u64> for Unsigned9Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<usize> for Unsigned9Bit
impl TryFrom<usize> for Unsigned9Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl WordCommon for Unsigned9Bit
impl WordCommon for Unsigned9Bit
impl Copy for Unsigned9Bit
impl Eq for Unsigned9Bit
Auto Trait Implementations§
impl Freeze for Unsigned9Bit
impl RefUnwindSafe for Unsigned9Bit
impl Send for Unsigned9Bit
impl Sync for Unsigned9Bit
impl Unpin for Unsigned9Bit
impl UnwindSafe for Unsigned9Bit
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.