[][src]Struct reclaim::Retired

pub struct Retired<R>(_, _);

A type-erased fat pointer to a retired record.

Methods

impl<R: Reclaim + 'static> Retired<R>[src]

pub unsafe fn new_unchecked<'a, T: 'a>(record: NonNull<T>) -> Self[src]

Creates a new Retired record from a raw pointer.

Safety

The caller has to ensure numerous safety invariants in order for a Retired record to be used safely:

  • the given record pointer must point to a valid heap allocated value
  • the record must have been allocated as part of a Record of the appropriate [LocalReclaim] implementation
  • if the type of the retired record implements Drop and contains any non-static references, it must be ensured that these are not accessed by the drop function.

pub fn as_ptr(&self) -> *const ()[src]

Converts a retired record to a raw pointer.

Since retired records are type-erased trait object (fat) pointers to retired values that should no longer be used, only the 'address' part of the pointer is returned, i.e. a pointer to an ().

pub fn address(&self) -> usize[src]

Returns the numeric representation of the retired record's memory address.

pub unsafe fn reclaim(&mut self)[src]

Reclaims the retired record by dropping it and de-allocating its memory.

Safety

This method must not be called more than once or when some other thread or scope still has some reference to the record.

Trait Implementations

impl<R: Reclaim + 'static> PartialEq<Retired<R>> for Retired<R>[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<R: Reclaim + 'static> PartialOrd<Retired<R>> for Retired<R>[src]

#[must_use] fn lt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use] fn le(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use] fn gt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use] fn ge(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<R: Reclaim + 'static> Eq for Retired<R>[src]

impl<R: Reclaim + 'static> Ord for Retired<R>[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl<R: Reclaim + 'static> Display for Retired<R>[src]

impl<R: Reclaim + 'static> Debug for Retired<R>[src]

Auto Trait Implementations

impl<R> !Unpin for Retired<R>

impl<R> !Sync for Retired<R>

impl<R> !Send for Retired<R>

impl<R> !RefUnwindSafe for Retired<R>

impl<R> !UnwindSafe for Retired<R>

Blanket Implementations

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

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

impl<T> ToString for T where
    T: Display + ?Sized
[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> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<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