pub struct ByteAddr(pub u32);Expand description
A memory address expressed in bytes
Tuple Fields§
§0: u32Implementations§
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 const fn page_subaddr(&self) -> ByteAddr
pub const fn page_subaddr(&self) -> ByteAddr
The subaddress of this address relative to its containing Page
The number of bytes this address is beyond the first byte of the page which contains it.
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 const fn checked_add(self, rhs: u32) -> Option<Self>
pub const fn checked_add(self, rhs: u32) -> Option<Self>
Add an offset to an address, returning None on overflow.
Sourcepub const fn saturating_add(self, rhs: u32) -> Self
pub const fn saturating_add(self, rhs: u32) -> Self
Add an offset to an address, saturating on overflow.
Sourcepub const fn wrapping_add(self, rhs: u32) -> Self
pub const 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 for ByteAddr
impl AddAssign for ByteAddr
Source§fn add_assign(&mut self, rhs: ByteAddr)
fn add_assign(&mut self, rhs: ByteAddr)
+= operation. Read moreSource§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)
+= 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)
+= operation. Read more