Struct containerof::OwnBox [] [src]

pub struct OwnBox<T> { /* 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>
[src]

Get value pointer address.

Construct an OwnBox from an IntrusiveAlias pointer. Unsafe because this allows trivial construction of pointer aliases.

Move ownership of an OwnBox into an IntrusiveAlias pointer. Unsafe because this allows trivial construction of pointer aliases.

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.

Construct an OwnBox from a Box.

Construct a Box from an OwnBox. Should only be called on an OwnBox that was constructed via from_box (or convert::From>). Unsafe, because the OwnBox may not have been constructed from a Box, and if it hasn't, then dropping the resulting Box will result in an attempt to free an invalid pointer.

Trait Implementations

impl<T> From<Box<T>> for OwnBox<T>
[src]

Performs the conversion.

impl<T> Deref for OwnBox<T>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<T> DerefMut for OwnBox<T>
[src]

The method called to mutably dereference a value

impl<T> Drop for OwnBox<T>
[src]

A method called when the value goes out of scope. Read more