pub trait CollectionMut: Collection {
type ItemMut<'a>: DerefMut<Target = Self::Item>
where Self: 'a;
// Required method
fn upcast_item_mut<'short, 'long: 'short>(
r: Self::ItemMut<'long>,
) -> Self::ItemMut<'short>
where Self: 'long;
}Expand description
Abstract collection that can be mutably referenced.
Required Associated Types§
Required Methods§
Sourcefn upcast_item_mut<'short, 'long: 'short>(
r: Self::ItemMut<'long>,
) -> Self::ItemMut<'short>where
Self: 'long,
fn upcast_item_mut<'short, 'long: 'short>(
r: Self::ItemMut<'long>,
) -> Self::ItemMut<'short>where
Self: 'long,
Changes an item mutable reference into a shorter lived mutable reference.
See the CollectionRef::upcast_item_ref function for more information.
You can use the covariant_item_mut! macro to automatically
implement this function.
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.