AtomicCellStorable

Trait AtomicCellStorable 

Source
pub unsafe trait AtomicCellStorable {
    const TAKEN_VALUE: usize;

    // Required methods
    fn into_value(self) -> usize;
    unsafe fn from_value(value: usize) -> Self;
}
Expand description

It is up to the implementer to ensure this is safe to implement.

from_value and into_value should never panic nor return TAKEN_VALUE. It is also up to the implementer to ensure that if T implements Clone, its implementation of clone() will never panic.

Required Associated Constants§

Source

const TAKEN_VALUE: usize

A sentinel value that a valid instance should never occupy.

Required Methods§

Source

fn into_value(self) -> usize

Convert an instance into a raw value, transferring ownership.

Source

unsafe fn from_value(value: usize) -> Self

Convert a raw value back into an instance.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> AtomicCellStorable for Option<Arc<T>>

Source§

const TAKEN_VALUE: usize = 18_446_744_073_709_551_615usize

Source§

fn into_value(self) -> usize

Source§

unsafe fn from_value(value: usize) -> Self

Source§

impl<T> AtomicCellStorable for Option<Weak<T>>

Source§

const TAKEN_VALUE: usize = 18_446_744_073_709_551_614usize

Source§

fn into_value(self) -> usize

Source§

unsafe fn from_value(value: usize) -> Self

Source§

impl<T> AtomicCellStorable for Arc<T>

Source§

const TAKEN_VALUE: usize = 18_446_744_073_709_551_615usize

Source§

fn into_value(self) -> usize

Source§

unsafe fn from_value(value: usize) -> Self

Source§

impl<T> AtomicCellStorable for Weak<T>

Source§

const TAKEN_VALUE: usize = 18_446_744_073_709_551_614usize

Source§

fn into_value(self) -> usize

Source§

unsafe fn from_value(value: usize) -> Self

Implementors§