pub struct Address(/* private fields */);Expand description
Memory address of an AST node in arena.
Implementations§
Source§impl Address
impl Address
Sourcepub fn from_ptr<T>(p: *const T) -> Self
pub fn from_ptr<T>(p: *const T) -> Self
Get the memory address of a pointer to an AST node in arena.
The pointer must point to an AST node in the arena (not on the stack),
or the returned Address will be meaningless.
If the AST node is in a Box, the address is guaranteed to be a unique identifier
for the duration of the arena’s existence.
If the node is in a Vec, then the Address may not remain accurate if the Vec
is resized or has elements added or removed before this node.
Trait Implementations§
Source§impl GetAddress for Address
impl GetAddress for Address
impl Copy for Address
impl Eq for Address
impl StructuralPartialEq for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnwindSafe for Address
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