Struct containerof::OwnBox
[−]
[src]
pub struct OwnBox<T> { // some fields omitted }
Represent ownership of an object via ownership of an intrusive
field within the object. Differs from Rust-standard Box<T>
in
that dropping an OwnBox<T>
instance is a bug.
Methods
impl<T> OwnBox<T>
fn get_address(&self) -> usize
Get value pointer address.
unsafe fn from_alias(pointer: IntrusiveAlias) -> OwnBox<T>
Construct an OwnBox from an IntrusiveAlias pointer. Unsafe because this allows trivial construction of pointer aliases.
unsafe fn into_alias(self) -> IntrusiveAlias
Move ownership of an OwnBox into an IntrusiveAlias pointer. Unsafe because this allows trivial construction of pointer aliases.
unsafe fn as_alias<'a>(&'a self) -> &'a IntrusiveAlias
Return a borrow-pointer of an IntrusiveAlias with same address as the OwnBox. Unsafe because working with IntrusiveAlias structures (that is, raw pointers) is unsafe.
fn from_box(b: Box<T>) -> OwnBox<T>
Construct an OwnBox from a Box.
unsafe fn into_box(self) -> Box<T>
Construct a Box from an OwnBox. Should only be called on an
OwnBox that was constructed via from_box (or
convert::From