#[repr(C)]pub struct ByteAddr(/* private fields */);
Expand description
A ByteAddr
is a value representing the address of zero or more bytes of memory.
Trait Implementations§
Source§impl Address for ByteAddr
impl Address for ByteAddr
Source§fn from_usize(val: usize) -> ByteAddr
fn from_usize(val: usize) -> ByteAddr
Constructor for a byte address from a raw usize
.
let ba = ByteAddr::from_usize(0xdeadbeef);
Source§fn as_usize(&self) -> usize
fn as_usize(&self) -> usize
Deconstructor for a byte address into a raw usize
value.
let ba = ByteAddr::from_usize(0xdeadbeef);
assert!(ba.as_usize() == 3735928559);
Source§fn verify(self) -> bool
fn verify(self) -> bool
All byte addresses are valid:
let ba = ByteAddr::from_usize(0xdeadbeef);
assert!(ba.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 ByteAddr
impl Ord for ByteAddr
Source§impl PartialOrd for ByteAddr
impl PartialOrd for ByteAddr
impl Copy for ByteAddr
impl Eq 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