Trait containerof::Intrusive [] [src]

pub trait Intrusive: IntrusiveBase {
    unsafe fn from_alias(_: IntrusiveAlias) -> Self;
    unsafe fn into_alias(self) -> IntrusiveAlias;
    unsafe fn as_alias_mut<'a>(&'a mut self) -> &'a mut IntrusiveAlias;
    unsafe fn of_alias<'a>(_: &'a IntrusiveAlias) -> &'a Self;
    unsafe fn of_alias_mut<'a>(ia: &'a mut IntrusiveAlias) -> &'a mut Self;
    fn from_container(_: OwnBox<Self::Container>) -> Self;
    fn into_container(self) -> OwnBox<Self::Container>;
    fn of_container<'a>(_: &'a Self::Container) -> BorrowBox<'a, Self>;
    fn of_container_mut<'a>(
        _: &'a mut Self::Container
    ) -> BorrowBoxMut<'a, Self>; fn as_container<'a>(&'a self) -> &'a Self::Container; fn as_container_mut<'a>(&'a mut self) -> &'a mut Self::Container; unsafe fn from_field(_: OwnBox<Self::Field>) -> Self; unsafe fn into_field(self) -> OwnBox<Self::Field>; unsafe fn of_field<'a>(_: &'a Self::Field) -> BorrowBox<'a, Self>; unsafe fn of_field_mut<'a>(_: &'a mut Self::Field) -> BorrowBoxMut<'a, Self>; fn as_field<'a>(&'a self) -> &'a Self::Field; fn as_field_mut<'a>(&'a mut self) -> &'a mut Self::Field; }

Trait defining routines for translation between containing structure and intrusive field. The only implementors of this trait should be the translation-types defined by the containerof_intrusive! macro.

Required Methods

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

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

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

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

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

Represent ownership of a container as ownership of an Intrusive pointer type. (Inverse of into_container.)

Represent ownership of an Intrusive pointer type as ownership of its container. (Inverse of from_container.)

Represent a borrow of an intrusive type via a borrow of its container.

Represent a mutable borrow of an intrusive type via a mutable borrow of its container.

Grant referential access to the container of this intrusive pointer type.

Grant mutable referential access to the container of this intrusive pointer type.

Assuming the "field" is a field in the container object, take ownership of the field as an intrusive pointer, allowing eventual translation back to the container. (Inverse of into_field.)

Represent ownership of the container object as ownership of the intrusive field in the object. (Inverse of from_field.)

Represent a borrow of an intrusive type via a borrow of the intrusive field.

Represent a mutable borrow of an intrusive type via a mutable borrow of the intrusive field.

Grant referential access to the intrusive field represented by this intrusive pointer.

Grant mutable referential access to the intrusive field represented by this intrusive pointer.

Implementors