[−][src]Struct aliasable::AliasableMut
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
AliasableMut
s and no references to a location. - You may hold any number of
AliasableMut
s and any number of shared references to a location at once. - You may hold any number of
AliasableMut
s 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]
T: Debug,
impl<T: ?Sized> Deref for AliasableMut<'_, T>
[src]
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]
T: Send,
impl<T: ?Sized> StableDeref for AliasableMut<'_, T>
[src]
impl<T: ?Sized> Sync for AliasableMut<'_, T> where
T: Sync,
[src]
T: Sync,
Auto Trait Implementations
impl<'a, T: ?Sized> RefUnwindSafe for AliasableMut<'a, T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<'a, T: ?Sized> Unpin for AliasableMut<'a, T>
[src]
impl<'a, T: ?Sized> UnwindSafe for AliasableMut<'a, T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoAliasable for T where
T: AliasableDeref,
[src]
T: AliasableDeref,
type Target = T
The aliasable type to convert to.
pub fn into_aliasable(self) -> <T as IntoAliasable>::Target
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,