pub trait SumDomain<K> {
// Required method
fn keys(&self) -> impl Iterator<Item = K> + '_;
}Expand description
Domain over which the sum! macro iterates. Lets a single sum accept either
a Set (with typed key decoding via FromIndexKey) or a borrowed slice
of Copy keys, without intermediate conversions.
Returns an iterator (rather than taking a callback) so the trait method
monomorphizes through to the loop body in [__sum_over], allowing inlining
in hot sums. Implementations are typically one line.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".