Trait chromiumoxide::cdp::CustomEvent

source ·
pub trait CustomEvent: Any + DeserializeOwned + MethodType + Send + Sync {
    // Provided method
    fn from_json(event: Value) -> Result<Self, Error>
       where Self: Sized + 'static { ... }
}
Expand description

This trait allows for implementing custom events that are not covered by the chrome protocol definitions.

Every CustomEvent also requires an implementation of chromiumoxide_types::MethodType and it must be DeserializeOwned (#[derive(serde::Deserialize)]). This is necessary to identify match this type against the provided method identifier of a CdpEventMessage and to properly deserialize it from a serde_json::Value

Provided Methods§

source

fn from_json(event: Value) -> Result<Self, Error>
where Self: Sized + 'static,

Used to convert the json event into in instance of this type

Object Safety§

This trait is not object safe.

Implementors§