pub trait EmitEvent {
    // Required method
    fn until_event<E: JsCast + 'static>(
        &self,
        name: Cow<'static, str>
    ) -> EventFutureStream<E> ;
}
Expand description

Implemented for EventTarget.

let _ev = event_target.until_event::<web_sys::Event>("eventname".into()).await;
// do something after event

Required Methods§

source

fn until_event<E: JsCast + 'static>( &self, name: Cow<'static, str> ) -> EventFutureStream<E>

Wait until an event with the specified name is fired. The return type is both a Future and a Stream that yields the event object.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl EmitEvent for EventTarget

source§

fn until_event<E: JsCast + 'static>( &self, name: Cow<'static, str> ) -> EventFutureStream<E>

Implementors§