[][src]Trait reclaim::MarkedPointer

pub trait MarkedPointer: Sized + Internal {
    type Pointer: NonNullable<Item = Self::Item, MarkBits = Self::MarkBits>;
    type Item: Sized;
    type MarkBits: Unsigned;
    fn as_marked_ptr(&self) -> MarkedPtr<Self::Item, Self::MarkBits>;
fn into_marked_ptr(self) -> MarkedPtr<Self::Item, Self::MarkBits>;
fn marked(_: Self, tag: usize) -> Marked<Self::Pointer>;
fn unmarked(_: Self) -> Self;
fn decompose(_: Self) -> (Self, usize);
unsafe fn from_marked_ptr(
        marked: MarkedPtr<Self::Item, Self::MarkBits>
    ) -> Self;
unsafe fn from_marked_non_null(
        marked: MarkedNonNull<Self::Item, Self::MarkBits>
    ) -> Self; }

Trait for nullable and non-nullable markable pointer types.

Associated Types

type Pointer: NonNullable<Item = Self::Item, MarkBits = Self::MarkBits>

The pointer type.

type Item: Sized

The pointed-to type.

type MarkBits: Unsigned

Number of bits available for tagging.

Loading content...

Required methods

fn as_marked_ptr(&self) -> MarkedPtr<Self::Item, Self::MarkBits>

Returns the equivalent raw marked pointer.

Note

For types like Shared, Shared and Unlinked, which implement Deref this method may conflict with inherent methods of the de-referenced type and goes against Rust's API guidelines. This is a deliberate trade-off for enabling more ergonomic usage of this method

fn into_marked_ptr(self) -> MarkedPtr<Self::Item, Self::MarkBits>

Consumes self and returns the equivalent raw marked pointer.

Note

For types like Shared, Shared and Unlinked, which implement Deref this method may conflict with inherent methods of the de-referenced type and goes against Rust's API guidelines. This is a deliberate trade-off for enabling more ergonomic usage of this method

fn marked(_: Self, tag: usize) -> Marked<Self::Pointer>

Consumes the Self and returns the same value with the specified tag wrapped in a Marked.

fn unmarked(_: Self) -> Self

Consumes the Self and returns the same value but without any tag.

fn decompose(_: Self) -> (Self, usize)

Decomposes the Self, returning the original value without its previous tag and the separated tag.

unsafe fn from_marked_ptr(marked: MarkedPtr<Self::Item, Self::MarkBits>) -> Self

Constructs a Self from a raw marked pointer.

Safety

The caller has to ensure that raw is a valid pointer for the respective Self type. If Self is nullable, a null pointer is a valid value. Otherwise, all values must be valid pointers.

unsafe fn from_marked_non_null(
    marked: MarkedNonNull<Self::Item, Self::MarkBits>
) -> Self

Constructs a Self from a raw non-null marked pointer

Safety

The same caveats as with from_marked_ptr apply as well.

Loading content...

Implementations on Foreign Types

impl<U, T, N: Unsigned> MarkedPointer for Option<U> where
    U: MarkedPointer<Pointer = U, Item = T, MarkBits = N> + NonNullable<Item = T, MarkBits = N>, 
[src]

type Pointer = U

type Item = T

type MarkBits = N

Loading content...

Implementors

impl<'g, T, R: Reclaim, N: Unsigned> MarkedPointer for Shared<'g, T, R, N>[src]

type Pointer = Self

type Item = T

type MarkBits = N

impl<T, R: Reclaim, N: Unsigned> MarkedPointer for Owned<T, R, N>[src]

type Pointer = Self

type Item = T

type MarkBits = N

impl<T, R: Reclaim, N: Unsigned> MarkedPointer for Unlinked<T, R, N>[src]

type Pointer = Self

type Item = T

type MarkBits = N

impl<T, R: Reclaim, N: Unsigned> MarkedPointer for Unprotected<T, R, N>[src]

type Pointer = Self

type Item = T

type MarkBits = N

impl<U, T, N: Unsigned> MarkedPointer for Marked<U> where
    U: MarkedPointer<Pointer = U, Item = T, MarkBits = N> + NonNullable<Item = T, MarkBits = N>, 
[src]

type Pointer = U

type Item = T

type MarkBits = N

Loading content...