[][src]Trait smart_pointer::IntoMut

pub trait IntoMut<T: ?Sized>: SmartPointer<T> {
    type MutablePointer: SmartPointerMut<T> + Into<Self>;
    fn can_make_mut(this: &Self) -> bool;
unsafe fn into_mut_unchecked(this: Self) -> Self::MutablePointer;
unsafe fn get_mut_unchecked(this: &Self) -> &mut T; fn into_mut(this: Self) -> Result<Self::MutablePointer, Self> { ... }
fn get_mut(this: &Self) -> Option<&mut T> { ... } }

A SmartPointer which might grant mutable access, depending on run-time checks.

Associated Types

Loading content...

Required methods

fn can_make_mut(this: &Self) -> bool

Check whether converting into a mutable version would succeed.

unsafe fn into_mut_unchecked(this: Self) -> Self::MutablePointer

Convert into a mutable version without performing runtime checks for upholding any invariants.

Safety: Calling this is safe if and only if can_make_mut returns true.

unsafe fn get_mut_unchecked(this: &Self) -> &mut T

Obtain a mutable reference to the wrapped value without performing runtime checks for upholding any invariants.

Safety: Calling this is safe if and only if can_make_mut returns true.

Loading content...

Provided methods

fn into_mut(this: Self) -> Result<Self::MutablePointer, Self>

Try converting into a mutable version of the pointer.

fn get_mut(this: &Self) -> Option<&mut T>

Try obtaining a mutable reference to the wrapped value.

Loading content...

Implementors

Loading content...