pub trait ContainerValue:
Hash
+ Eq
+ Clone
+ Send
+ Sync
+ 'static {
// Required methods
fn rebuild_contents(&mut self, rebuilder: &dyn Rebuilder) -> bool;
fn iter(&self) -> impl Iterator<Item = Value> + '_;
}Expand description
A trait implemented by container types.
Containers behave a lot like base values, but they include extra trait methods to support rebuilding of container contents and merging containers that become equal after a rebuild pass has taken place.
Required Methods§
Sourcefn rebuild_contents(&mut self, rebuilder: &dyn Rebuilder) -> bool
fn rebuild_contents(&mut self, rebuilder: &dyn Rebuilder) -> bool
Rebuild an additional container in place according the the given Rebuilder.
If this method returns false then the container must not have been modified (i.e. it must
hash to the same value, and compare equal to a copy of itself before the call).
Sourcefn iter(&self) -> impl Iterator<Item = Value> + '_
fn iter(&self) -> impl Iterator<Item = Value> + '_
Iterate over the contents of the container.
Note that containers can be more structured than just a sequence of values. This iterator
is used to populate an index that in turn is used to speed up rebuilds. If a value in the
container is eligible for a rebuild and it is not mentioned by this iterator, the outer
[Containers] registry may skip rebuilding this container.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.