[][src]Struct reclaim::Record

pub struct Record<T, R: Reclaim> { /* fields omitted */ }

A record type that is associated with a specific reclamation scheme.

Whenever a new Owned or (non-null) Atomic is created, a value of this type is allocated on the heap as a wrapper for the desired record. The record and its header are never directly exposed to the data structure using a given memory reclamation scheme and should only be accessed by the reclamation scheme itself.

Methods

impl<T, R: Reclaim> Record<T, R>[src]

pub fn new(elem: T) -> Self[src]

Creates a new record with the specified elem and a default header.

pub fn with_header(elem: T, header: R::RecordHeader) -> Self[src]

Creates a new record with the specified elem and header.

pub fn header(&self) -> &R::RecordHeader[src]

Returns a reference to the record's header.

pub fn elem(&self) -> &T[src]

Returns a reference to the record's element.

pub unsafe fn from_raw_non_null(elem: NonNull<T>) -> NonNull<Self>[src]

Calculates the address of the Record for the given pointer to a wrapped non-nullable elem and returns the resulting pointer.

Safety

The elem pointer must be a valid pointer to an instance of T that was constructed as part of a Record. Otherwise, the pointer arithmetic used to determine the address will result in a pointer to unrelated memory, which is likely to lead to undefined behaviour.

pub unsafe fn from_raw(elem: *mut T) -> NonNull<Self>[src]

Calculates the address of the Record for the given pointer to a wrapped elem and returns the resulting pointer.

Safety

The elem pointer must be a valid pointer to an instance of T that was constructed as part of a Record. Otherwise, the pointer arithmetic used to determine the address will result in a pointer to unrelated memory, which is likely to lead to undefined behaviour.

pub unsafe fn header_from_raw<'a>(elem: *mut T) -> &'a R::RecordHeader[src]

Returns a reference to the header for the record at the pointed-to location of the pointer elem.

Safety

The pointer elem must be a valid pointer to an instance of T that was allocated as part of a Record. Otherwise, the pointer arithmetic used to calculate the header's address will be incorrect and lead to undefined behavior.

pub unsafe fn header_from_raw_non_null<'a>(
    elem: NonNull<T>
) -> &'a R::RecordHeader
[src]

Returns a reference to the header for the record at the pointed-to location of the non-nullable pointer elem.

Safety

The pointer elem must be a valid pointer to an instance of T that was allocated as part of a Record. Otherwise, the pointer arithmetic used to calculate the header's address will be incorrect and lead to undefined behavior.

pub fn offset_header() -> usize[src]

Returns the offset in bytes from the address of a record to its header field.

pub fn offset_elem() -> usize[src]

Returns the offset in bytes from the address of a record to its element field.

Auto Trait Implementations

impl<T, R> Send for Record<T, R> where
    T: Send,
    <R as Reclaim>::RecordHeader: Send

impl<T, R> Unpin for Record<T, R> where
    T: Unpin,
    <R as Reclaim>::RecordHeader: Unpin

impl<T, R> Sync for Record<T, R> where
    T: Sync,
    <R as Reclaim>::RecordHeader: Sync

impl<T, R> UnwindSafe for Record<T, R> where
    T: UnwindSafe,
    <R as Reclaim>::RecordHeader: UnwindSafe

impl<T, R> RefUnwindSafe for Record<T, R> where
    T: RefUnwindSafe,
    <R as Reclaim>::RecordHeader: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self