Struct containerof::BorrowBox [] [src]

pub struct BorrowBox<'a, T: 'a> {
    // some fields omitted
}

A borrow-pointer that does not require explicit ownership of the value being borrowed. Used to allow construction of the Intrusive structure translation type from a borrow pointer.

Methods

impl<'a, T> BorrowBox<'a, T> where T: Intrusive

fn new(source: &'a T) -> BorrowBox<'a, T>

Build a BorrowBox from a borrow pointer.

unsafe fn new_from<U>(pointer: IntrusiveAlias, _lifetime: &'a U) -> BorrowBox<'a, T>

Build a BorrowBox from a raw pointer and a lifetime. Unsafe, because this API cannot guarantee that the pointer value is of the same type as the destination borrow box.

Trait Implementations

impl<'a, T> Deref for BorrowBox<'a, T> where T: Intrusive

type Target = T

fn deref<'b>(&'b self) -> &'b T

Derived Implementations

impl<'a, T: Debug + 'a> Debug for BorrowBox<'a, T> where T: Debug

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