[][src]Trait intrusive_collections::PointerOps

pub unsafe trait PointerOps {
    type Value: ?Sized;
    type Pointer;
    unsafe fn from_raw(&self, value: *const Self::Value) -> Self::Pointer;
fn into_raw(&self, ptr: Self::Pointer) -> *const Self::Value; }

Trait for pointer conversion operations.

Value is the actual object type managed by the collection. This type will typically have a link as a struct field.

Pointer is a pointer type which "owns" an object of type Value. Operations which insert an element into an intrusive collection will accept such a pointer and operations which remove an element will return this type.

Associated Types

type Value: ?Sized

Object type which is inserted into an intrusive collection.

type Pointer

Pointer type which owns an instance of a value.

Loading content...

Required methods

unsafe fn from_raw(&self, value: *const Self::Value) -> Self::Pointer

Constructs an owned pointer from a raw pointer.

Safety

The raw pointer must have been previously returned by into_raw.

An implementation of from_raw must not panic.

fn into_raw(&self, ptr: Self::Pointer) -> *const Self::Value

Consumes the owned pointer and returns a raw pointer to the owned object.

Loading content...

Implementors

impl<'a, T: ?Sized> PointerOps for DefaultPointerOps<&'a T>[src]

type Value = T

type Pointer = &'a T

impl<T: ?Sized> PointerOps for DefaultPointerOps<UnsafeRef<T>>[src]

type Value = T

type Pointer = UnsafeRef<T>

impl<T: ?Sized> PointerOps for DefaultPointerOps<Box<T>>[src]

type Value = T

type Pointer = Box<T>

impl<T: ?Sized> PointerOps for DefaultPointerOps<Rc<T>>[src]

type Value = T

type Pointer = Rc<T>

impl<T: ?Sized> PointerOps for DefaultPointerOps<Arc<T>>[src]

type Value = T

type Pointer = Arc<T>

Loading content...