Trait intrusive_collections::PointerOps[][src]

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; }
Expand description

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

Object type which is inserted into an intrusive collection.

Pointer type which owns an instance of a value.

Required methods

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.

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

Implementors