Trait containerof::IntrusiveBase [] [src]

pub trait IntrusiveBase {
    type Container;
    type Field;
    fn offset() -> usize;
    unsafe fn new(IntrusiveAlias) -> Self;
    unsafe fn as_alias<'a>(&'a self) -> &'a IntrusiveAlias;
}

Minimal trait that, when implemented for a type, allows for the blanket implementation of the Intrusive trait for that type. This is the trait implemented by the containerof_intrusive! macro, and the only implementors of this trait should be the translation-types defined by the containerof_intrusive! macro.

Associated Types

type Container

Type of containing structure.

type Field

Type of intrusive field within containing structure.

Required Methods

fn offset() -> usize

Returns offset of intrusive field within containing structure.

unsafe fn new(IntrusiveAlias) -> Self

Ownership-moving translation from generic intrusive pointer alias to type-safe intrusive pointer.

unsafe fn as_alias<'a>(&'a self) -> &'a IntrusiveAlias

Allow using type-safe intrusive pointer as generic intrusive pointer.

Implementors