Trait former::HashMapLike
source · pub trait HashMapLike<K, E>{
// Required method
fn insert(&mut self, k: K, e: E) -> Option<E>;
// Provided method
fn former(
self
) -> HashMapSubformer<K, E, Self, Self, impl FormingEnd<Self, Self>> { ... }
}
Expand description
A trait for types that behave like hash maps, supporting insertion and custom forming behaviors.
This trait allows for generic operations on hash map-like data structures, enabling the insertion of key-value pairs and the creation of formers for more complex construction patterns.
§Type Parameters
K
: The type of keys stored in the hash map. Must implementEq
andHash
.E
: The type of elements (values) stored in the hash map.
Required Methods§
Provided Methods§
sourcefn former(
self
) -> HashMapSubformer<K, E, Self, Self, impl FormingEnd<Self, Self>>
fn former( self ) -> HashMapSubformer<K, E, Self, Self, impl FormingEnd<Self, Self>>
Return former.
Object Safety§
This trait is not object safe.