pub trait MapMapValues<OldVal> {
type MapValue<NewVal>;
// Required method
fn map_values<NewVal, MapFn>(self, map_fn: MapFn) -> Self::MapValue<NewVal>
where MapFn: FnMut(OldVal) -> NewVal;
}Expand description
Trait for transforming the values of a map without changing the overall type of the data structure.
Required Associated Types§
Required Methods§
Sourcefn map_values<NewVal, MapFn>(self, map_fn: MapFn) -> Self::MapValue<NewVal>where
MapFn: FnMut(OldVal) -> NewVal,
fn map_values<NewVal, MapFn>(self, map_fn: MapFn) -> Self::MapValue<NewVal>where
MapFn: FnMut(OldVal) -> NewVal,
Map the values into using the map_fn.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<Key, OldVal> MapMapValues<OldVal> for BTreeMap<Key, OldVal>
Available on crate feature alloc only.
impl<Key, OldVal> MapMapValues<OldVal> for BTreeMap<Key, OldVal>
Available on crate feature
alloc only.Source§impl<Key, OldVal> MapMapValues<OldVal> for HashMap<Key, OldVal>
Available on crate feature std only.
impl<Key, OldVal> MapMapValues<OldVal> for HashMap<Key, OldVal>
Available on crate feature
std only.