pub struct Unsigned18Bit {
pub(crate) bits: u32,
}
Expand description
Unsigned18Bit
is the value of a “half” of the 36-bit TX-2
machine word. We use this type to hold STUV-memory addresses,
among other things. Physical memory addresses though are only 17
bits wide. The remaining bit can be used to “mark” an address
either for tracing (when it’s an instruction address) or for
deferred addressing (when it’s an operand address).
Fields§
§bits: u32
Implementations§
Source§impl Unsigned18Bit
impl Unsigned18Bit
const MODULUS: u32 = 262_144u32
const VALUE_BITS: u32 = 262_143u32
pub const MAX: Self
pub const ZERO: Self
pub const ONE: Self
pub const MIN: Self = Self::ZERO
pub const fn new<const N: u32>() -> Unsigned18Bit
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) -> Signed18Bit
pub fn wrapping_add(self, rhs: Unsigned18Bit) -> Unsigned18Bit
pub fn wrapping_sub(self, rhs: Unsigned18Bit) -> Unsigned18Bit
pub fn checked_add(self, rhs: Unsigned18Bit) -> Option<Unsigned18Bit>
pub fn checked_sub(self, rhs: Unsigned18Bit) -> Option<Unsigned18Bit>
pub fn wrapping_mul(self, rhs: Unsigned18Bit) -> Unsigned18Bit
pub fn checked_mul(self, rhs: Unsigned18Bit) -> Option<Unsigned18Bit>
pub fn checked_div(self, rhs: Unsigned18Bit) -> Option<Unsigned18Bit>
pub const fn abs(self) -> Self
pub const fn overflowing_abs(self) -> (Self, bool)
pub const fn and(self, mask: u32) -> Self
pub const fn bitor(self, mask: u32) -> Self
Trait Implementations§
Source§impl BitAnd<Unsigned18Bit> for Unsigned36Bit
impl BitAnd<Unsigned18Bit> for Unsigned36Bit
Source§type Output = Unsigned18Bit
type Output = Unsigned18Bit
The resulting type after applying the
&
operator.Source§fn bitand(self, rhs: Unsigned18Bit) -> Unsigned18Bit
fn bitand(self, rhs: Unsigned18Bit) -> Unsigned18Bit
Performs the
&
operation. Read moreSource§impl BitAnd<u32> for Unsigned18Bit
impl BitAnd<u32> for Unsigned18Bit
Source§impl BitAnd for Unsigned18Bit
impl BitAnd for Unsigned18Bit
Source§impl BitOr<u32> for Unsigned18Bit
impl BitOr<u32> for Unsigned18Bit
Source§impl BitOr for Unsigned18Bit
impl BitOr for Unsigned18Bit
Source§impl BitXor<u32> for Unsigned18Bit
impl BitXor<u32> for Unsigned18Bit
Source§impl BitXor for Unsigned18Bit
impl BitXor for Unsigned18Bit
Source§impl Clone for Unsigned18Bit
impl Clone for Unsigned18Bit
Source§fn clone(&self) -> Unsigned18Bit
fn clone(&self) -> Unsigned18Bit
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 Unsigned18Bit
impl Debug for Unsigned18Bit
Source§impl Default for Unsigned18Bit
impl Default for Unsigned18Bit
Source§impl Display for Unsigned18Bit
impl Display for Unsigned18Bit
Source§impl From<&Address> for Unsigned18Bit
impl From<&Address> for Unsigned18Bit
Source§impl From<Address> for Unsigned18Bit
impl From<Address> for Unsigned18Bit
Source§impl From<Unsigned18Bit> for Address
impl From<Unsigned18Bit> for Address
Source§fn from(a: Unsigned18Bit) -> Address
fn from(a: Unsigned18Bit) -> Address
Converts to this type from the input type.
Source§impl From<Unsigned18Bit> for Unsigned36Bit
impl From<Unsigned18Bit> for Unsigned36Bit
Source§fn from(n: Unsigned18Bit) -> Self
fn from(n: Unsigned18Bit) -> Self
Converts to this type from the input type.
Source§impl From<Unsigned18Bit> for i32
impl From<Unsigned18Bit> for i32
Source§fn from(n: Unsigned18Bit) -> i32
fn from(n: Unsigned18Bit) -> i32
Converts to this type from the input type.
Source§impl From<Unsigned18Bit> for i64
impl From<Unsigned18Bit> for i64
Source§fn from(n: Unsigned18Bit) -> i64
fn from(n: Unsigned18Bit) -> i64
Converts to this type from the input type.
Source§impl From<Unsigned18Bit> for isize
impl From<Unsigned18Bit> for isize
Source§fn from(n: Unsigned18Bit) -> isize
fn from(n: Unsigned18Bit) -> isize
Converts to this type from the input type.
Source§impl From<Unsigned18Bit> for u32
impl From<Unsigned18Bit> for u32
Source§fn from(n: Unsigned18Bit) -> u32
fn from(n: Unsigned18Bit) -> u32
Converts to this type from the input type.
Source§impl From<Unsigned18Bit> for u64
impl From<Unsigned18Bit> for u64
Source§fn from(n: Unsigned18Bit) -> u64
fn from(n: Unsigned18Bit) -> u64
Converts to this type from the input type.
Source§impl From<Unsigned18Bit> for usize
impl From<Unsigned18Bit> for usize
Source§fn from(n: Unsigned18Bit) -> usize
fn from(n: Unsigned18Bit) -> usize
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<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<u16> for Unsigned18Bit
impl From<u16> for Unsigned18Bit
Source§impl From<u8> for Unsigned18Bit
impl From<u8> for Unsigned18Bit
Source§impl Hash for Unsigned18Bit
impl Hash for Unsigned18Bit
Source§impl IndexBy<Unsigned18Bit> for Address
impl IndexBy<Unsigned18Bit> for Address
fn index_by(&self, delta: Unsigned18Bit) -> Address
Source§impl Not for Unsigned18Bit
impl Not for Unsigned18Bit
Source§impl Octal for Unsigned18Bit
impl Octal for Unsigned18Bit
Source§impl Ord for Unsigned18Bit
impl Ord for Unsigned18Bit
Source§fn cmp(&self, other: &Unsigned18Bit) -> Ordering
fn cmp(&self, other: &Unsigned18Bit) -> 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 Unsigned18Bit
impl<T> PartialEq<T> for Unsigned18Bit
Source§impl PartialOrd<u32> for Unsigned18Bit
impl PartialOrd<u32> for Unsigned18Bit
Source§impl PartialOrd<u64> for Unsigned18Bit
impl PartialOrd<u64> for Unsigned18Bit
Source§impl PartialOrd for Unsigned18Bit
impl PartialOrd for Unsigned18Bit
Source§impl Serialize for Unsigned18Bit
impl Serialize for Unsigned18Bit
Source§impl Shl<u32> for Unsigned18Bit
impl Shl<u32> for Unsigned18Bit
Source§impl Shl for Unsigned18Bit
impl Shl for Unsigned18Bit
Source§type Output = Unsigned18Bit
type Output = Unsigned18Bit
The resulting type after applying the
<<
operator.Source§fn shl(self, shift_by: Unsigned18Bit) -> Self
fn shl(self, shift_by: Unsigned18Bit) -> Self
Performs the
<<
operation. Read moreSource§impl Shr<u32> for Unsigned18Bit
impl Shr<u32> for Unsigned18Bit
Source§impl Shr for Unsigned18Bit
impl Shr for Unsigned18Bit
Source§impl Sum for Unsigned18Bit
impl Sum for Unsigned18Bit
Source§impl TryFrom<Unsigned18Bit> for Signed18Bit
impl TryFrom<Unsigned18Bit> for Signed18Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Unsigned18Bit) -> Result<Self, ConversionFailed>
fn try_from(n: Unsigned18Bit) -> Result<Self, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<Unsigned18Bit> for Unsigned12Bit
impl TryFrom<Unsigned18Bit> for Unsigned12Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Unsigned18Bit) -> Result<Self, ConversionFailed>
fn try_from(n: Unsigned18Bit) -> Result<Self, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<Unsigned18Bit> for Unsigned6Bit
impl TryFrom<Unsigned18Bit> for Unsigned6Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Unsigned18Bit) -> Result<Self, ConversionFailed>
fn try_from(n: Unsigned18Bit) -> Result<Self, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<Unsigned18Bit> for i16
impl TryFrom<Unsigned18Bit> for i16
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Unsigned18Bit) -> Result<i16, ConversionFailed>
fn try_from(n: Unsigned18Bit) -> Result<i16, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<Unsigned18Bit> for i8
impl TryFrom<Unsigned18Bit> for i8
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Unsigned18Bit) -> Result<i8, ConversionFailed>
fn try_from(n: Unsigned18Bit) -> Result<i8, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<Unsigned18Bit> for u16
impl TryFrom<Unsigned18Bit> for u16
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Unsigned18Bit) -> Result<u16, ConversionFailed>
fn try_from(n: Unsigned18Bit) -> Result<u16, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<Unsigned18Bit> for u8
impl TryFrom<Unsigned18Bit> for u8
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Unsigned18Bit) -> Result<u8, ConversionFailed>
fn try_from(n: Unsigned18Bit) -> Result<u8, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<Unsigned36Bit> for Unsigned18Bit
impl TryFrom<Unsigned36Bit> for Unsigned18Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§fn try_from(n: Unsigned36Bit) -> Result<Self, ConversionFailed>
fn try_from(n: Unsigned36Bit) -> Result<Self, ConversionFailed>
Performs the conversion.
Source§impl TryFrom<i16> for Unsigned18Bit
impl TryFrom<i16> for Unsigned18Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<i32> for Unsigned18Bit
impl TryFrom<i32> for Unsigned18Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<i64> for Unsigned18Bit
impl TryFrom<i64> for Unsigned18Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<i8> for Unsigned18Bit
impl TryFrom<i8> for Unsigned18Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<u32> for Unsigned18Bit
impl TryFrom<u32> for Unsigned18Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<u64> for Unsigned18Bit
impl TryFrom<u64> for Unsigned18Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl TryFrom<usize> for Unsigned18Bit
impl TryFrom<usize> for Unsigned18Bit
Source§type Error = ConversionFailed
type Error = ConversionFailed
The type returned in the event of a conversion error.
Source§impl WordCommon for Unsigned18Bit
impl WordCommon for Unsigned18Bit
impl Copy for Unsigned18Bit
impl Eq for Unsigned18Bit
Auto Trait Implementations§
impl Freeze for Unsigned18Bit
impl RefUnwindSafe for Unsigned18Bit
impl Send for Unsigned18Bit
impl Sync for Unsigned18Bit
impl Unpin for Unsigned18Bit
impl UnwindSafe for Unsigned18Bit
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.