pub fn add_producer<T>(&mut self, config: ProducerConfig<'_, T>)
    where
        T: EventProducer,
    {
        let mut events: BTreeSet<_> = config.events.into_iter().map(|e| e.into()).collect();
        events.extend(config.singleton_events.into_iter().map(|e| e.into()));
        self.producers_registered.append(&mut events.clone());
        let sender = match config.producer_type {
            ProducerType::Internal => self.internal_sender.clone(),
            ProducerType::External => self.external_sender.clone(),
        };
        let dispatcher = Dispatcher::new(events, sender);
        config.producer.set_dispatcher(dispatcher);
    }
/// Registers an event producer with the given configuration specifying the types of events the
/// given producer is allowed to emit.
Registers an event producer with the given configuration specifying the types of events the
given producer is allowed to emit.
Registers an event producer with the given configuration specifying the types of events the given producer is allowed to emit .
pub fn add_producer<T>(&mut self, config: ProducerConfig<'_, T>)
    where
        T: EventProducer,
    {
        let mut events: BTreeSet<_> = config.events.into_iter().map(|e| e.into()).collect();
        events.extend(config.singleton_events.into_iter().map(|e| e.into()));
        self.producers_registered.append(&mut events.clone());
        let sender = match config.producer_type {
            ProducerType::Internal => self.internal_sender.clone(),
            ProducerType::External => self.external_sender.clone(),
        };
        let dispatcher = Dispatcher::new(events, sender);
        config.producer.set_dispatcher(dispatcher);
    }
pub fn add_producer < T > ( & mut self , config : ProducerConfig < ' _ , T > ) where T : EventProducer , { let mut events : BTreeSet < _ > = config . events . into_iter ( ) . map ( | e | e . into ( ) ) . collect ( ) ; events . extend ( config . singleton_events . into_iter ( ) . map ( | e | e . into ( ) ) ) ; self . producers_registered . append ( & mut events . clone ( ) ) ; let sender = match config . producer_type { ProducerType :: Internal => self . internal_sender . clone ( ) , ProducerType :: External => self . external_sender . clone ( ) , } ; let dispatcher = Dispatcher :: new ( events , sender ) ; config . producer . set_dispatcher ( dispatcher ) ; }
Registers an event producer with the given configuration specifying the types of events the
given producer is allowed to emit.
Registers an event producer with the given configuration specifying the types of events the given producer is allowed to emit .
&mut self
config
ProducerConfig<'_, T>
&mut self
config
ProducerConfig<'_, T>