pub struct EventResponse {
pub method: String,
pub params: Value,
}Expand description
CDP events arrive as {"method": "Domain.event", "params": {...}} with no
outer envelope distinguishing them from commands/errors (unlike BiDi which
wraps events in a typed structure). EventResponse captures this raw shape
so we can route by method name and then deserialize into concrete event
types on demand via TryInto.
Fields§
§method: String§params: ValueImplementations§
Source§impl EventResponse
impl EventResponse
Sourcepub fn try_into_event<T: DeserializeOwned>(self) -> Result<T, Error>
pub fn try_into_event<T: DeserializeOwned>(self) -> Result<T, Error>
Attempt to convert this raw event into a concrete CDP event type.
The concrete type (e.g. TargetCreated) is expected to deserialize from
the full {"method": "...", "params": {...}} shape — not just the params.
pub fn identifier(&self) -> &str
Trait Implementations§
Source§impl Clone for EventResponse
impl Clone for EventResponse
Source§fn clone(&self) -> EventResponse
fn clone(&self) -> EventResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EventResponse
impl Debug for EventResponse
Source§impl<'de> Deserialize<'de> for EventResponse
impl<'de> Deserialize<'de> for EventResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EventResponse
impl RefUnwindSafe for EventResponse
impl Send for EventResponse
impl Sync for EventResponse
impl Unpin for EventResponse
impl UnsafeUnpin for EventResponse
impl UnwindSafe for EventResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more