Macro wayland_client::declare_delegating_handler [] [src]

macro_rules! declare_delegating_handler {
    ($handler_struct: ty, $($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);