ViewMut

Trait ViewMut 

Source
pub trait ViewMut {
    type Mut<'a>
       where Self: 'a;

    // Required method
    fn view_mut(&mut self) -> Self::Mut<'_>;
}
Expand description

Represents a type that can be mutably ‘viewed’ (derefed). Mimics the impl for std::ops::DerefMut but makes use of GAT’s in order to provide non &mut refs. Useful for things like tensor views.

Required Associated Types§

Source

type Mut<'a> where Self: 'a

Required Methods§

Source

fn view_mut(&mut self) -> Self::Mut<'_>

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.

Implementors§

Source§

impl<D: DerefMut> ViewMut for D

Source§

type Mut<'a> = &'a mut <D as Deref>::Target where Self: 'a