#[repr(C)]pub struct VoidAddr(/* private fields */);Expand description
A VoidAddr, much like a void* in C, is available for those
in need of a quick-and-dirty way of representing the value of a
pointer without actually being able to read from or write to that
pointer.
Implementations§
Trait Implementations§
Source§impl Address for VoidAddr
impl Address for VoidAddr
Source§fn from_usize(val: usize) -> VoidAddr
fn from_usize(val: usize) -> VoidAddr
Construct a void address:
let va = VoidAddr::from_usize(0xdeadbeef);Source§fn as_usize(&self) -> usize
fn as_usize(&self) -> usize
Deconstruct a void address:
let va = VoidAddr::from_usize(0xdeadbeef);
assert!(va.as_usize() == 3735928559);Source§fn verify(self) -> bool
fn verify(self) -> bool
Trivially verify that this void address looks valid. All values are valid:
let va = VoidAddr::from_usize(0xdeadbeef);
assert!(va.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 VoidAddr
impl Ord for VoidAddr
Source§impl PartialOrd for VoidAddr
impl PartialOrd for VoidAddr
impl Copy for VoidAddr
impl Eq for VoidAddr
Auto Trait Implementations§
impl Freeze for VoidAddr
impl RefUnwindSafe for VoidAddr
impl Send for VoidAddr
impl Sync for VoidAddr
impl Unpin for VoidAddr
impl UnwindSafe for VoidAddr
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