Skip to main content

EventSender

Trait EventSender 

Source
pub trait EventSender: Send + Sync {
    // Required method
    fn send_event(&self, method: &str, params: Value);

    // Provided method
    fn send_session_event(&self, session_id: &str, method: &str, params: Value) { ... }
}
Expand description

Event sender trait. Implemented internally by cdp-server, injected into DomainHandlers so they can broadcast CDP events.

Constraints: Send + Sync + Clone.

Required Methods§

Source

fn send_event(&self, method: &str, params: Value)

Broadcast an event to all sessions that have enabled the domain extracted from method (format: “Domain.eventName”).

Provided Methods§

Source

fn send_session_event(&self, session_id: &str, method: &str, params: Value)

Broadcast a session-scoped event (flattened CDP sessions): the event JSON carries sessionId, so clients route it to the attached target session. Default impl degrades to a plain broadcast (registries without session knowledge lose only the routing tag).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§