pub trait IntoAtomic:
IsAtomic<Atomic = False>
+ Sized
+ Send
+ Sync {
type AtomicType: Atomic<NonAtomicType = Self>;
// Required methods
fn to_atomic(self) -> Self::AtomicType;
fn into_atomic_array<const N: usize>(
data: [Self; N],
) -> [Self::AtomicType; N];
fn from_atomic_array<const N: usize>(
data: [Self::AtomicType; N],
) -> [Self; N];
fn get_mut_slice(this: &mut [Self::AtomicType]) -> &mut [Self];
fn from_mut_slice(this: &mut [Self]) -> &mut [Self::AtomicType];
fn get_mut_array<const N: usize>(
this: &mut [Self::AtomicType; N],
) -> &mut [Self; N];
fn from_mut_array<const N: usize>(
this: &mut [Self; N],
) -> &mut [Self::AtomicType; N];
}Expand description
A trait for types that have an equivalent atomic type.
Required Associated Types§
Sourcetype AtomicType: Atomic<NonAtomicType = Self>
type AtomicType: Atomic<NonAtomicType = Self>
The atomic variant of the type.
Required Methods§
Sourcefn to_atomic(self) -> Self::AtomicType
fn to_atomic(self) -> Self::AtomicType
Convert self into the atomic variant of Self
Sourcefn into_atomic_array<const N: usize>(data: [Self; N]) -> [Self::AtomicType; N]
fn into_atomic_array<const N: usize>(data: [Self; N]) -> [Self::AtomicType; N]
Convert an array of non-atomic values into an array of atomic values.
Sourcefn from_atomic_array<const N: usize>(data: [Self::AtomicType; N]) -> [Self; N]
fn from_atomic_array<const N: usize>(data: [Self::AtomicType; N]) -> [Self; N]
Convert an array of atomic values into an array of non-atomic values.
Sourcefn get_mut_slice(this: &mut [Self::AtomicType]) -> &mut [Self]
fn get_mut_slice(this: &mut [Self::AtomicType]) -> &mut [Self]
Convert a slice of non-atomic values into a slice of atomic values.
Sourcefn from_mut_slice(this: &mut [Self]) -> &mut [Self::AtomicType]
fn from_mut_slice(this: &mut [Self]) -> &mut [Self::AtomicType]
Convert a slice of atomic values into a slice of non-atomic values.
Sourcefn get_mut_array<const N: usize>(
this: &mut [Self::AtomicType; N],
) -> &mut [Self; N]
fn get_mut_array<const N: usize>( this: &mut [Self::AtomicType; N], ) -> &mut [Self; N]
Convert a reference to an array of non-atomic values into a reference to an array of atomic values.
Sourcefn from_mut_array<const N: usize>(
this: &mut [Self; N],
) -> &mut [Self::AtomicType; N]
fn from_mut_array<const N: usize>( this: &mut [Self; N], ) -> &mut [Self::AtomicType; N]
Convert a reference to an array of atomic values into a reference to an array of non-atomic values.
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.