macro_rules! dyn_newtype_impl_dyn_clone_passthrough {
($name:ident) => { ... };
}
Expand description
Implement Clone
on a “dyn newtype”
… by calling clone
method on the underlying
dyn Trait
.
Cloning dyn Trait
s is non trivial due to object-safety.
Note: the underlying dyn Trait
needs to implement
a fn clone(&self) -> Newtype
for this to work,
and this macro does not check or do anything about it.
If the newtype is using Arc
you probably want
to just use standard #[derive(Clone)]
to clone
the Arc
itself.