Trait chromiumoxide_cdp::cdp::CustomEvent[][src]

pub trait CustomEvent: Any + DeserializeOwned + MethodType + Send + Sync {
    fn from_json(event: Value) -> Result<Self>
    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

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

Implementors