#[repr(C)]pub struct WordAddr(/* private fields */);Expand description
A WordAddr is a value representing the address of a word of memory.
Trait Implementations§
Source§impl Address for WordAddr
impl Address for WordAddr
Source§fn from_usize(val: usize) -> WordAddr
fn from_usize(val: usize) -> WordAddr
Constructor for a word address from a raw usize.
let wa = WordAddr::from_usize(0xdeadbeef);Source§fn as_usize(&self) -> usize
fn as_usize(&self) -> usize
Deconstructor for a word address into a raw usize value.
let wa = WordAddr::from_usize(0xdeadbeef);
assert!(wa.as_usize() == 3735928559);Source§fn verify(self) -> bool
fn verify(self) -> bool
All possible word values are valid:
let wa = WordAddr::from_usize(0xdeadbeef);
assert!(wa.verify());Source§fn offset<T, A: Address>(&self, offset: usize) -> A
fn offset<T, A: Address>(&self, offset: usize) -> A
Offset this
&self address some number of instances of type T, producing an address of
type A. Read moreSource§fn is_zero(&self) -> bool
fn is_zero(&self) -> bool
Is the value of this address equivalent to the (universal) null value? Read more
Source§fn align_up<A: Address>(&self, align: usize) -> A
fn align_up<A: Address>(&self, align: usize) -> A
Align this pointer up (increasing value) to the nearest address with a value
aligned to
align bytes. For example the following properties hold: Read moreSource§fn gte<A: Address>(&self, addr: A) -> bool
fn gte<A: Address>(&self, addr: A) -> bool
Is the value of this address greater than or equal to the value of the given address? Read more
Source§fn greater<A: Address>(&self, addr: A) -> bool
fn greater<A: Address>(&self, addr: A) -> bool
Is the value of this address greater than the value of the given address? Read more
Source§fn lte<A: Address>(&self, addr: A) -> bool
fn lte<A: Address>(&self, addr: A) -> bool
Is the value of this address less than or equal to the value of the given address? Read more
Source§fn less<A: Address>(&self, addr: A) -> bool
fn less<A: Address>(&self, addr: A) -> bool
Is the value of this address less than the value of the given address? Read more
Source§fn is_aligned_to(&self, align: usize) -> bool
fn is_aligned_to(&self, align: usize) -> bool
Is the value of this address exactly aligned to the given alignment? Read more
Source§fn from_ptr<T>(ptr: *const T) -> Self
fn from_ptr<T>(ptr: *const T) -> Self
Construct an address from an immutable constant Rust pointer type. Read more
Source§fn to_ptr<T>(&self) -> *const T
fn to_ptr<T>(&self) -> *const T
Deconstruct an address into an immutable constant Rust pointer type. Read more
Source§fn to_ptr_mut<T>(&self) -> *mut T
fn to_ptr_mut<T>(&self) -> *mut T
Construct an address from a mutable constant Rust pointer type. Read more
Source§impl Ord for WordAddr
impl Ord for WordAddr
Source§impl PartialOrd for WordAddr
impl PartialOrd for WordAddr
impl Copy for WordAddr
impl Eq for WordAddr
Auto Trait Implementations§
impl Freeze for WordAddr
impl RefUnwindSafe for WordAddr
impl Send for WordAddr
impl Sync for WordAddr
impl Unpin for WordAddr
impl UnwindSafe for WordAddr
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