Skip to main content

DictRetain

Trait DictRetain 

Source
pub trait DictRetain {
    // Required method
    fn retain(&mut self, keep: impl FnMut(&HarnStr, &mut VmValue) -> bool);
}
Expand description

retain for the persistent DictMap.

imbl::OrdMap has no in-place retain (it is structurally shared), so this rebuilds the map keeping only the entries for which keep returns true. The closure signature mirrors BTreeMap::retain (&K, &mut V) so call sites read identically. Cold-path helper (filter/dedup), so the rebuild cost is not on any hot loop.

Required Methods§

Source

fn retain(&mut self, keep: impl FnMut(&HarnStr, &mut VmValue) -> bool)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§