pub trait KeyedRef: Keyed {
type KeyRef<'a>: Clone + Deref<Target = Self::Key>
where Self: 'a;
// Required method
fn upcast_key_ref<'short, 'long: 'short>(
r: Self::KeyRef<'long>,
) -> Self::KeyRef<'short>
where Self: 'long;
}Expand description
Abstract keyed collection whose key can be referenced.
Required Associated Types§
Required Methods§
Sourcefn upcast_key_ref<'short, 'long: 'short>(
r: Self::KeyRef<'long>,
) -> Self::KeyRef<'short>where
Self: 'long,
fn upcast_key_ref<'short, 'long: 'short>(
r: Self::KeyRef<'long>,
) -> Self::KeyRef<'short>where
Self: 'long,
Changes a key reference into a shorter lived reference.
See the CollectionRef::upcast_item_ref function for more information.
You can use the covariant_key_ref! 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".