[−][src]Struct reclaim::Retired
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 thedrop
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> PartialOrd<Retired<R>> for Retired<R>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.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) -> bool
1.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) -> bool
1.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) -> bool
1.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> PartialEq<Retired<R>> for Retired<R>
[src]
fn eq(&self, other: &Self) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<R: Reclaim + 'static> Ord for Retired<R>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl<R: Reclaim + 'static> Eq for Retired<R>
[src]
impl<R: Reclaim + 'static> Display for Retired<R>
[src]
impl<R: Reclaim + 'static> Debug for Retired<R>
[src]
Auto Trait Implementations
impl<R> !Sync for Retired<R>
impl<R> !Send for Retired<R>
impl<R> !Unpin for Retired<R>
impl<R> !RefUnwindSafe for Retired<R>
impl<R> !UnwindSafe for Retired<R>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self