Trait former::HashMapLike

source ·
pub trait HashMapLike<K, E>
where K: Eq + Hash, Self: Sized + Default,
{ // 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 implement Eq and Hash.
  • E: The type of elements (values) stored in the hash map.

Required Methods§

source

fn insert(&mut self, k: K, e: E) -> Option<E>

Inserts a key-value pair into the map.

Provided Methods§

source

fn former( self ) -> HashMapSubformer<K, E, Self, Self, impl FormingEnd<Self, Self>>

Return former.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<K, E> HashMapLike<K, E> for HashMap<K, E>
where K: Eq + Hash, Self: Sized + Default,

source§

fn insert(&mut self, k: K, e: E) -> Option<E>

Implementors§