ValueRebuilder

Trait ValueRebuilder 

Source
pub trait ValueRebuilder: Send + Sync {
    // Required method
    fn rebuild_val(&self, val: Value) -> Value;

    // Provided method
    fn rebuild_slice(&self, vals: &mut [Value]) -> bool { ... }
}
Expand description

Remap individual values (e.g. to their union-find leaders) — the value-level half of rebuilding, enough to rebuild a single container’s contents (see crate::ContainerValue::rebuild_contents).

Required Methods§

Source

fn rebuild_val(&self, val: Value) -> Value

Rebuild a single value.

Provided Methods§

Source

fn rebuild_slice(&self, vals: &mut [Value]) -> bool

Rebuild a slice of values in place, returning true if any values were changed.

Defaults to mapping each value through ValueRebuilder::rebuild_val; implementors may override for efficiency.

Implementors§