/// Subscribes to events of a provided set of EventTypes.
Subscribes to events of a provided set of EventTypes.
Subscribes to events of a provided set of EventTypes .
pub async fn subscribe(&self, sync_mode: &SyncMode, events: Vec<RoutedEvent>) -> EventStream {
        // TODO(fxb/48510): get rid of this channel and use FIDL directly.
        let mut event_stream = EventStream::new();
        let mut dispatcher_map = self.dispatcher_map.lock().await;
        for event in events {
            let dispatchers = dispatcher_map.entry(event.source_name).or_insert(vec![]);
            let dispatcher =
                event_stream.create_dispatcher(sync_mode.clone(), event.scope_monikers);
            dispatchers.push(dispatcher);
        }
        event_stream
    }
pub async fn subscribe ( & self , sync_mode : & SyncMode , events : Vec < RoutedEvent > ) -> EventStream { // TODO(fxb/48510): get rid of this channel and use FIDL directly. let mut event_stream = EventStream :: new ( ) ; let mut dispatcher_map = self . dispatcher_map . lock ( ) . await ; for event in events { let dispatchers = dispatcher_map . entry ( event . source_name ) . or_insert ( vec ! [ ] ) ; let dispatcher = event_stream . create_dispatcher ( sync_mode . clone ( ) , event . scope_monikers ) ; dispatchers . push ( dispatcher ) ; } event_stream }
Subscribes to events of a provided set of EventTypes.
Subscribes to events of a provided set of EventTypes .
&self
sync_mode
&SyncMode
events
Vec<RoutedEvent>