[][src]Struct aliasable::AliasableMut

pub struct AliasableMut<'a, T: ?Sized> { /* fields omitted */ }

Basic aliasable alternative to &mut.

Note that this does not circumvent the core aliasing rules of Rust; if you use this to create multiple mutable references to a memory location at the same time, that is still UB. This type just adds a few abilities:

  • You may hold any number of AliasableMuts and no references to a location.
  • You may hold any number of AliasableMuts and any number of shared references to a location at once.
  • You may hold any number of AliasableMuts and one mutable reference to a location at once.

Implementations

impl<'a, T: ?Sized> AliasableMut<'a, T>[src]

pub fn from_unique(ptr: &'a mut T) -> Self[src]

Construct an AliasableMut from an &mut.

pub fn into_unique(ptr: Self) -> &'a mut T[src]

Consumes self and converts it into a non-aliasable &mut.

pub fn into_unique_pin(pin: Pin<Self>) -> Pin<&'a mut T>[src]

Convert a pinned AliasableMut to a pinned &mut.

pub fn from_unique_pin(pin: Pin<&'a mut T>) -> Pin<Self>[src]

Convert a pinned &mut to a pinned AliasableMut.

Trait Implementations

impl<T: ?Sized> AliasableDeref for AliasableMut<'_, T>[src]

impl<T: ?Sized> AsMut<T> for AliasableMut<'_, T>[src]

impl<T: ?Sized> AsRef<T> for AliasableMut<'_, T>[src]

impl<T: ?Sized> Debug for AliasableMut<'_, T> where
    T: Debug
[src]

impl<T: ?Sized> Deref for AliasableMut<'_, T>[src]

type Target = T

The resulting type after dereferencing.

impl<T: ?Sized> DerefMut for AliasableMut<'_, T>[src]

impl<'a, T: ?Sized> From<&'a mut T> for AliasableMut<'a, T>[src]

impl<T: ?Sized> Send for AliasableMut<'_, T> where
    T: Send
[src]

impl<T: ?Sized> StableDeref for AliasableMut<'_, T>[src]

impl<T: ?Sized> Sync for AliasableMut<'_, T> where
    T: Sync
[src]

Auto Trait Implementations

impl<'a, T: ?Sized> RefUnwindSafe for AliasableMut<'a, T> where
    T: RefUnwindSafe
[src]

impl<'a, T: ?Sized> Unpin for AliasableMut<'a, T>[src]

impl<'a, T: ?Sized> UnwindSafe for AliasableMut<'a, T> where
    T: RefUnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoAliasable for T where
    T: AliasableDeref
[src]

type Target = T

The aliasable type to convert to.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.