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.

Trait Implementations

Derived Implementations

impl Debug for IntrusiveAlias

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Clone for IntrusiveAlias

fn clone(&self) -> IntrusiveAlias

fn clone_from(&mut self, source: &Self)

impl Copy for IntrusiveAlias

impl Eq for IntrusiveAlias

impl PartialEq for IntrusiveAlias

fn eq(&self, __arg_0: &IntrusiveAlias) -> bool

fn ne(&self, __arg_0: &IntrusiveAlias) -> bool