pub trait CdpCommand: Serialize {
type Returns: DeserializeOwned;
const METHOD: &'static str;
}Expand description
A typed CDP command.
Self is the request params type (must be Serialize); Returns is
the response type returned by Cdp::send / CdpSession::send. METHOD
is the wire name, e.g. "Page.navigate".
§Example
use serde::{Deserialize, Serialize};
use thirtyfour::cdp::CdpCommand;
#[derive(Serialize)]
struct GetTitleParams;
#[derive(Deserialize)]
struct GetTitleReturns {
title: String,
}
impl CdpCommand for GetTitleParams {
const METHOD: &'static str = "Page.getTitle";
type Returns = GetTitleReturns;
}Required Associated Constants§
Required Associated Types§
Sourcetype Returns: DeserializeOwned
type Returns: DeserializeOwned
Response type. Use Empty for commands that return {}.
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.