newtype_wrap_from_any

Macro newtype_wrap_from_any 

Source
macro_rules! newtype_wrap_from_any {
    ($wrapper: ident, $wrapped: ty) => { ... };
    ($wrapper: ty, $variant: ident, $wrapped: ty) => { ... };
}
Expand description

The same as newtype_wrap, except that the wrapping is implemented on all types U that convert to T via into().

Be careful when using this: there may be U types that you wish do not receive automatic wrapping. In such a case, you should use newtype_wrap on each U type separately.