pub trait AddListener<'a>: RawWrapper {
    type Events: 'a;

    // Required method
    fn add_listener(
        &self,
        events: Pin<Box<Self::Events>>
    ) -> Pin<Box<Self::Events>>;
}
Expand description

RawWrapper that can register listener. Ownership of the listener is not taken, so it’s should be stored somewhere. If this is possible, owned wrapper with the OwnListeners trait is preferred for usage.

Required Associated Types§

source

type Events: 'a

Events listener struct

Required Methods§

source

fn add_listener(&self, events: Pin<Box<Self::Events>>) -> Pin<Box<Self::Events>>

Register listener and return it.

Arguments
  • events - Events listener struct

Returns the registered listener instance. It should be alive to receive events.

Implementors§