pub struct ByteAddr(pub u32);
Expand description
A memory address expressed in bytes
Tuple Fields§
§0: u32
Implementations§
Source§impl ByteAddr
impl ByteAddr
Sourcepub const fn waddr(self) -> WordAddr
pub const fn waddr(self) -> WordAddr
Convert to a WordAddr
If the address is not aligned to a word boundary, this will return the highest aligned address smaller than the input address.
Sourcepub fn waddr_aligned(self) -> Option<WordAddr>
pub fn waddr_aligned(self) -> Option<WordAddr>
Sourcepub const fn is_aligned(&self) -> bool
pub const fn is_aligned(&self) -> bool
Reports if the address is aligned
Returns true
if the address is aligned to a word boundary, otherwise returns false
Sourcepub const fn is_null(&self) -> bool
pub const fn is_null(&self) -> bool
Reports if the address is null
The address 0x00000000
is null and will return true
, for all others returns false
.
Sourcepub fn wrapping_add(self, rhs: u32) -> Self
pub fn wrapping_add(self, rhs: u32) -> Self
Add an offset to an address
This will wrap on overflow, e.g. 0xFFFFFFFF + 0x00000001
is 0x00000000
.
Trait Implementations§
Source§impl AddAssign<u32> for ByteAddr
impl AddAssign<u32> for ByteAddr
Source§fn add_assign(&mut self, rhs: u32)
fn add_assign(&mut self, rhs: u32)
Performs the
+=
operation. Read moreSource§impl AddAssign<usize> for ByteAddr
impl AddAssign<usize> for ByteAddr
Source§fn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
Performs the
+=
operation. Read moreSource§impl AddAssign for ByteAddr
impl AddAssign for ByteAddr
Source§fn add_assign(&mut self, rhs: ByteAddr)
fn add_assign(&mut self, rhs: ByteAddr)
Performs the
+=
operation. Read moreSource§impl Ord for ByteAddr
impl Ord for ByteAddr
Source§impl PartialOrd for ByteAddr
impl PartialOrd for ByteAddr
impl Copy for ByteAddr
impl Eq for ByteAddr
impl StructuralPartialEq for ByteAddr
Auto Trait Implementations§
impl Freeze for ByteAddr
impl RefUnwindSafe for ByteAddr
impl Send for ByteAddr
impl Sync for ByteAddr
impl Unpin for ByteAddr
impl UnwindSafe for ByteAddr
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