Struct containerof::IntrusiveAlias
[−]
[src]
pub struct IntrusiveAlias(pub usize);
Alias that has the same representation as an intrusive translation type. The idea is to be able to use this alias for intrusive facility implementations, by defining the "true" implementation of the facility to use the single (but type-unsafe) IntrusiveAlias type, while allowing type-safe wrapper implementations to delegate their behavior to the implementation function.
Methods
impl IntrusiveAlias
fn new(addr: usize) -> IntrusiveAlias
Create an IntrusiveAlias instance from a pointer address.
unsafe fn new_of<T>(addr: &T) -> IntrusiveAlias
Create an IntrusiveAlias instance which points to a borrowed pointer. Unsafe, because it deliberately creates an alias to a borrowed object.
fn get_address(&self) -> usize
Get back the pointer address from which the IntrusiveAlias
was
constructed.