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§
Sourceconst TAKEN_VALUE: usize
const TAKEN_VALUE: usize
A sentinel value that a valid instance should never occupy.
Required Methods§
Sourcefn into_value(self) -> usize
fn into_value(self) -> usize
Convert an instance into a raw value, transferring ownership.
Sourceunsafe fn from_value(value: usize) -> Self
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.