Skip to main content

CdpEventManagement

Trait CdpEventManagement 

Source
pub trait CdpEventManagement {
    // Required methods
    fn get_events(&mut self) -> &mut Arc<StdMutex<Vec<CdpEvent>>>;
    fn push_event(&mut self, event: CdpEvent);

    // Provided methods
    fn add_event_handler<F, R>(
        &mut self,
        methods: impl IntoIterator<Item = impl Into<String>>,
        handler: F,
    ) -> String
       where F: FnMut(EventResponse) -> R + Send + Sync + 'static,
             R: Future<Output = ()> + Send + 'static { ... }
    fn remove_cdp_event_handler(&mut self, id: &str) { ... }
    fn event_dispatch(
        &mut self,
    ) -> impl Future<Output = (JoinHandle<()>, UnboundedSender<EventResponse>)> { ... }
}

Required Methods§

Source

fn get_events(&mut self) -> &mut Arc<StdMutex<Vec<CdpEvent>>>

Source

fn push_event(&mut self, event: CdpEvent)

Provided Methods§

Source

fn add_event_handler<F, R>( &mut self, methods: impl IntoIterator<Item = impl Into<String>>, handler: F, ) -> String
where F: FnMut(EventResponse) -> R + Send + Sync + 'static, R: Future<Output = ()> + Send + 'static,

Source

fn remove_cdp_event_handler(&mut self, id: &str)

Source

fn event_dispatch( &mut self, ) -> impl Future<Output = (JoinHandle<()>, UnboundedSender<EventResponse>)>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§