macro_rules! impl_wrapper_unary {
($s:ident.$field:ident { $($op:ident.$call:ident),* $(,)?}) => { ... };
($s:ident { $($op:ident.$call:ident),* $(,)?}) => { ... };
(@impl $s:ident::$op:ident.$call:ident($field:ident)) => { ... };
(@impl $s:ident::$op:ident.$call:ident(0)) => { ... };
}
Expand description
the [impl_wrapper_unary!
] macro implements binary operations for a wrapper type.
§Syntax
For tuple structs:
ⓘ
impl_wrapper_unary! {
${struct} { Op1.call, Op2.call, ... }
}
For structs with named fields:
ⓘ
impl_wrapper_unary! {
${struct}.${field} { Op1.call, Op2.call, ... }
}
Note: The target struct must have exactly one field;