Trait RangeMutexBackingStorage

Source
pub unsafe trait RangeMutexBackingStorage<T>: AsMut<[T]> + AsRef<[T]> {
    type AsUnsafeCell: AsMut<[UnsafeCell<T>]> + AsRef<[UnsafeCell<T>]>;

    // Required methods
    fn into_unsafecell(self) -> Self::AsUnsafeCell;
    fn from_unsafecell(value: Self::AsUnsafeCell) -> Self;
}
Expand description

The trait for types which can be used as the backing store for a RangeMutex.

§Safety

  • AsUnsafeCell must be safe to send and share between threads if T is Send (it does not need to implement Send or Sync)
  • Self and AsUnsafeCell’s AsRef::as_ref and AsMut::as_mut implementations must be “well-behaved”, similar to std::ops::DerefPure

Required Associated Types§

Required Methods§

Source

fn into_unsafecell(self) -> Self::AsUnsafeCell

Source

fn from_unsafecell(value: Self::AsUnsafeCell) -> Self

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<'a, T> RangeMutexBackingStorage<T> for &'a mut [T]

Source§

impl<'a, T, const N: usize> RangeMutexBackingStorage<T> for &'a mut [T; N]

Source§

type AsUnsafeCell = &'a mut [UnsafeCell<T>; N]

Source§

fn into_unsafecell(self) -> Self::AsUnsafeCell

Source§

fn from_unsafecell(value: Self::AsUnsafeCell) -> Self

Source§

impl<T> RangeMutexBackingStorage<T> for Box<[T]>

Source§

impl<T> RangeMutexBackingStorage<T> for Vec<T>

Source§

impl<T, const N: usize> RangeMutexBackingStorage<T> for [T; N]

Implementors§