Skip to main content

NodeIdRemap

Trait NodeIdRemap 

Source
pub trait NodeIdRemap {
    // Required method
    fn remap_node_ids(&mut self, dom: DomId, map: &NodeIdMap);
}
Expand description

Implemented by EVERY manager (or cache) that keys state by NodeId.

One method on purpose: remapping and GC are the same pass, so it is impossible to do one and forget the other. Implementors MUST, for state belonging to dom:

  1. rewrite each key/field old to map.resolve(old), and
  2. drop the state whenever resolve returns None (unmounted node).

State belonging to any other DomId must be left alone.

Required Methods§

Source

fn remap_node_ids(&mut self, dom: DomId, map: &NodeIdMap)

Rewrite all NodeIds for dom and drop state for unmounted nodes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§