MakeMut

Trait MakeMut 

Source
pub unsafe trait MakeMut: Sized {
    type T: ?Sized;

    // Required method
    fn make_mut(this: &mut Self) -> &mut Self::T;

    // Provided method
    fn to_unique(this: Self) -> Self { ... }
}
Expand description

Generic [?Sized] make_mut support

§Safety

  • The implementation of make_mut and to_unique must ensure that strong_count are set to 1 and there are no weak references

Required Associated Types§

Source

type T: ?Sized

Required Methods§

Source

fn make_mut(this: &mut Self) -> &mut Self::T

Provided Methods§

Source

fn to_unique(this: Self) -> Self

Create unique reference and remove Weak

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 MakeMut for Rc<str>

Source§

type T = str

Source§

fn make_mut(this: &mut Self) -> &mut Self::T

Source§

impl MakeMut for Rc<CStr>

Source§

type T = CStr

Source§

fn make_mut(this: &mut Self) -> &mut Self::T

Source§

impl MakeMut for Rc<OsStr>

Source§

type T = OsStr

Source§

fn make_mut(this: &mut Self) -> &mut Self::T

Source§

impl MakeMut for Rc<Path>

Source§

type T = Path

Source§

fn make_mut(this: &mut Self) -> &mut Self::T

Source§

impl MakeMut for Arc<str>

Source§

type T = str

Source§

fn make_mut(this: &mut Self) -> &mut Self::T

Source§

impl MakeMut for Arc<CStr>

Source§

type T = CStr

Source§

fn make_mut(this: &mut Self) -> &mut Self::T

Source§

impl MakeMut for Arc<OsStr>

Source§

type T = OsStr

Source§

fn make_mut(this: &mut Self) -> &mut Self::T

Source§

impl MakeMut for Arc<Path>

Source§

type T = Path

Source§

fn make_mut(this: &mut Self) -> &mut Self::T

Source§

impl<T: Clone> MakeMut for Rc<[T]>

Source§

type T = [T]

Source§

fn make_mut(this: &mut Self) -> &mut Self::T

Source§

impl<T: Clone> MakeMut for Rc<T>

Source§

type T = T

Source§

fn make_mut(this: &mut Self) -> &mut Self::T

Source§

impl<T: Clone> MakeMut for Arc<[T]>

Source§

type T = [T]

Source§

fn make_mut(this: &mut Self) -> &mut Self::T

Source§

impl<T: Clone> MakeMut for Arc<T>

Source§

type T = T

Source§

fn make_mut(this: &mut Self) -> &mut Self::T

Implementors§