macro_rules! impl_custom_bounds_with_key_container { ($bounds:ident, $dyn:ident, $key_container:ty, $trait_name:ident) => { ... }; ($bounds:ident, $dyn:ident, $key_container:ty, $trait_name:ident, $(+ $marker_traits:ident)*) => { ... }; }
Expand description
Implements Bounds
& HasBounds
traits for $bounds
using $dyn
trait object and wrapping $trait_name
specifying KeyContainer with $key_container
.
Together with impl_dyn_trait_wrapper macro, it serves as simple way to implement custom Bounds
.
For example see how ContainerWithHashAndClone is used as KeyContainer to allow key to be cloneable.