Trait arc_cell::AtomicCellStorable
source · [−]pub unsafe trait AtomicCellStorable {
const TAKEN_VALUE: usize;
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.
Associated Constants
const TAKEN_VALUE: usize
const TAKEN_VALUE: usize
A sentinel value that a valid instance should never occupy.
Required methods
fn into_value(self) -> usize
fn into_value(self) -> usize
Convert an instance into a raw value, transferring ownership.
unsafe fn from_value(value: usize) -> Self
unsafe fn from_value(value: usize) -> Self
Convert a raw value back into an instance.