Macro wayland_client::declare_delegating_handler
[−]
[src]
macro_rules! declare_delegating_handler { ($handler_struct: ident <$($tyarg:ident : [$($trait: ident $(<$($traitarg:ty),*>)*),*]),*>, $($handler_field: ident).+ , $handler_trait: path, $handled_type: ty) => { ... }; ($handler_struct: ident, $($handler_field: ident).+ , $handler_trait: path, $handled_type: ty) => { ... }; }
Registers a handler type so it as delegating to one of its fields
This allows to declare your type as a handler, by delegating the impl to one of its fields (or subfields).
// MySubHandler is a proper handler for wl_foo events struct MySubHandler; struct MyHandler { sub: MySubHandler } declare_delegating_handler!(MySubHandler, sub, wl_foo::Handler, wl_foo::WlFoo);
The syntax to use if your type has type arguments is the same as for declare_handler!()
.