pub struct WordAddr(pub u32);
Expand description
A memory address expressed in words
Only capable of representing aligned addresses, as adjacent WordAddrs are a word apart.
Tuple Fields§
§0: u32
Implementations§
Source§impl WordAddr
impl WordAddr
Sourcepub fn page_idx(&self) -> u32
pub fn page_idx(&self) -> u32
Gives the crate::image::Page containing this memory address
Sourcepub fn page_subaddr(&self) -> WordAddr
pub fn page_subaddr(&self) -> WordAddr
The subaddress of this address relative to its containing crate::image::Page
The number of words this address is beyond the first word of the page which contains it.
Sourcepub fn inc(&mut self)
pub fn inc(&mut self)
Increments this address to the next word
This increments the address without returning any value.
Sourcepub fn postfix_inc(&mut self) -> Self
pub fn postfix_inc(&mut self) -> Self
Increments this address to the next word and returns its previous value
This is a postfixing increment, analogous to addr++
in C; the value this evaluates to is the value prior to the increment.
Trait Implementations§
Source§impl AddAssign<u32> for WordAddr
impl AddAssign<u32> for WordAddr
Source§fn add_assign(&mut self, rhs: u32)
fn add_assign(&mut self, rhs: u32)
Performs the
+=
operation. Read moreSource§impl AddAssign<usize> for WordAddr
impl AddAssign<usize> for WordAddr
Source§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
Performs the
+=
operation. Read moreSource§impl AddAssign for WordAddr
impl AddAssign for WordAddr
Source§fn add_assign(&mut self, rhs: WordAddr)
fn add_assign(&mut self, rhs: WordAddr)
Performs the
+=
operation. Read moreSource§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
impl StructuralPartialEq 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