pub trait SimpleCollectionMut: CollectionMut {
    // Required method
    fn into_mut<'r>(r: Self::ItemMut<'r>) -> &'r mut Self::Item
       where Self: 'r;
}
Expand description

Collection where each item reference can be converted into a standard “simple” rust reference.

This trait is particularly useful to avoid having to include where bounds of the form for<'r> T::ItemMut<'r>: Into<&'r mut T::Item>, which can currently lead the compiler to try to prove T: 'static (see https://github.com/rust-lang/rust/pull/96709#issuecomment-1182403490) for more details.

Required Methods§

source

fn into_mut<'r>(r: Self::ItemMut<'r>) -> &'r mut Self::Itemwhere Self: 'r,

Implementations on Foreign Types§

source§

impl<K, V> SimpleCollectionMut for BTreeMap<K, V>

source§

fn into_mut<'r>(r: Self::ItemMut<'r>) -> &'r mut Self::Itemwhere Self: 'r,

source§

impl<T> SimpleCollectionMut for BTreeSet<T>

source§

fn into_mut<'r>(r: Self::ItemMut<'r>) -> &'r mut Self::Itemwhere Self: 'r,

source§

impl<T> SimpleCollectionMut for Vec<T>

source§

fn into_mut<'r>(r: Self::ItemMut<'r>) -> &'r mut Self::Itemwhere Self: 'r,

source§

impl<T> SimpleCollectionMut for VecDeque<T>

source§

fn into_mut<'r>(r: Self::ItemMut<'r>) -> &'r mut Self::Itemwhere Self: 'r,

source§

impl<K, V> SimpleCollectionMut for HashMap<K, V>

source§

fn into_mut<'r>(r: Self::ItemMut<'r>) -> &'r mut Self::Itemwhere Self: 'r,

source§

impl<T> SimpleCollectionMut for HashSet<T>

source§

fn into_mut<'r>(r: Self::ItemMut<'r>) -> &'r mut Self::Itemwhere Self: 'r,

Implementors§