macro_rules! delegate_apply_ret {
($_Self:expr => | $arg:ident | $($Rest:tt)*) => { ... };
($_Self:tt $($Rest:tt)*) => { ... };
}Expand description
This macro was generated by an invocation of delegated_enum.
Performs delegation of the enum by applying the same expression to all variants of the enum.
This macro is used in code generated by invocations of delegate_impl, though nothing stops you from using it manually.
§This macro accepts 2 different syntaxes:
ⓘ
// Simple
`delegate_apply_ret!{ enum_variable.method_name(comma,separated,method,args).continue_with_any_rust_expression() }`
// Closure
`delegate_apply_ret!{ enum_variable => |arg| any_rust_expression_that_uses_arg_parameter() }`§Example:
ⓘ
impl Clone for ApplyRet {
fn clone(&self) -> Self {
delegate_apply_ret! { self.clone() }
}
}