Re-exported from alloc::collections::hashmap::Drain!.
forall K, V, 'k.
struct Drain! { ... }
The map being taken apart: the bucket being walked, and the entry in it that comes next. Holds the map's capability, so nothing else can touch the entries meanwhile.
Methods
method takesource
fn take(&self) -> Option[(K, V)] { ... }
The next entry, moved out of the map and freed from it.
method finishsource
fn finish(self, f: fn(K, V) -> ()) -> () { ... }
Ends the drain: f disposes of every entry not yet taken, and the bucket array is freed.
Instances
instance Iterator[Drain![K, V, 'k] -> Pair[K, V]]source
forall K, V, 'k where Sized[K], Sized[V].
instance Iterator[Drain![K, V, 'k] -> Pair[K, V]] { ... }
The drained entries, each moved out as Pair { a: key, b: value }.