#[derive(Debug, Clone, serde::Serialize)]
pub struct BindingCalledParams {
#[serde(rename = "name")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub name: String,
#[serde(rename = "payload")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub payload: String,
#[serde(rename = "executionContextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub execution_context_id: crate::runtime::types::ExecutionContextId,
}
impl<'de> serde::Deserialize<'de> for BindingCalledParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = BindingCalledParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "name")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub name: String,
#[serde(rename = "payload")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub payload: String,
#[serde(rename = "executionContextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub execution_context_id: crate::runtime::types::ExecutionContextId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(BindingCalledParams {
name: fields.name,
payload: fields.payload,
execution_context_id: fields.execution_context_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct BindingCalled;
impl ydp_core::Event for BindingCalled {
type Params = BindingCalledParams;
const METHOD: &'static str = "Runtime.bindingCalled";
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum ConsoleApiCalledParamsType {
Log,
Debug,
Info,
Error,
Warning,
Dir,
Dirxml,
Table,
Trace,
Clear,
StartGroup,
StartGroupCollapsed,
EndGroup,
Assert,
Profile,
ProfileEnd,
Count,
TimeEnd,
Unknown(String),
}
impl ConsoleApiCalledParamsType {
pub fn as_str(&self) -> &str {
match self {
Self::Log => "log",
Self::Debug => "debug",
Self::Info => "info",
Self::Error => "error",
Self::Warning => "warning",
Self::Dir => "dir",
Self::Dirxml => "dirxml",
Self::Table => "table",
Self::Trace => "trace",
Self::Clear => "clear",
Self::StartGroup => "startGroup",
Self::StartGroupCollapsed => "startGroupCollapsed",
Self::EndGroup => "endGroup",
Self::Assert => "assert",
Self::Profile => "profile",
Self::ProfileEnd => "profileEnd",
Self::Count => "count",
Self::TimeEnd => "timeEnd",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for ConsoleApiCalledParamsType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for ConsoleApiCalledParamsType {
fn from(value: String) -> Self {
match value.as_str() {
"log" => ConsoleApiCalledParamsType::Log,
"debug" => ConsoleApiCalledParamsType::Debug,
"info" => ConsoleApiCalledParamsType::Info,
"error" => ConsoleApiCalledParamsType::Error,
"warning" => ConsoleApiCalledParamsType::Warning,
"dir" => ConsoleApiCalledParamsType::Dir,
"dirxml" => ConsoleApiCalledParamsType::Dirxml,
"table" => ConsoleApiCalledParamsType::Table,
"trace" => ConsoleApiCalledParamsType::Trace,
"clear" => ConsoleApiCalledParamsType::Clear,
"startGroup" => ConsoleApiCalledParamsType::StartGroup,
"startGroupCollapsed" => ConsoleApiCalledParamsType::StartGroupCollapsed,
"endGroup" => ConsoleApiCalledParamsType::EndGroup,
"assert" => ConsoleApiCalledParamsType::Assert,
"profile" => ConsoleApiCalledParamsType::Profile,
"profileEnd" => ConsoleApiCalledParamsType::ProfileEnd,
"count" => ConsoleApiCalledParamsType::Count,
"timeEnd" => ConsoleApiCalledParamsType::TimeEnd,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for ConsoleApiCalledParamsType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for ConsoleApiCalledParamsType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ConsoleApiCalledParamsType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"log" => ConsoleApiCalledParamsType::Log,
"debug" => ConsoleApiCalledParamsType::Debug,
"info" => ConsoleApiCalledParamsType::Info,
"error" => ConsoleApiCalledParamsType::Error,
"warning" => ConsoleApiCalledParamsType::Warning,
"dir" => ConsoleApiCalledParamsType::Dir,
"dirxml" => ConsoleApiCalledParamsType::Dirxml,
"table" => ConsoleApiCalledParamsType::Table,
"trace" => ConsoleApiCalledParamsType::Trace,
"clear" => ConsoleApiCalledParamsType::Clear,
"startGroup" => ConsoleApiCalledParamsType::StartGroup,
"startGroupCollapsed" => ConsoleApiCalledParamsType::StartGroupCollapsed,
"endGroup" => ConsoleApiCalledParamsType::EndGroup,
"assert" => ConsoleApiCalledParamsType::Assert,
"profile" => ConsoleApiCalledParamsType::Profile,
"profileEnd" => ConsoleApiCalledParamsType::ProfileEnd,
"count" => ConsoleApiCalledParamsType::Count,
"timeEnd" => ConsoleApiCalledParamsType::TimeEnd,
_ => ConsoleApiCalledParamsType::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(ConsoleApiCalledParamsType::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ConsoleApiCalledParams {
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: ConsoleApiCalledParamsType,
#[serde(rename = "args")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub args: Vec<crate::runtime::types::RemoteObject>,
#[serde(rename = "executionContextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub execution_context_id: crate::runtime::types::ExecutionContextId,
#[serde(rename = "timestamp")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub timestamp: crate::runtime::types::Timestamp,
#[serde(rename = "stackTrace")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub stack_trace: Option<crate::runtime::types::StackTrace>,
#[serde(rename = "context")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub context: Option<String>,
}
impl<'de> serde::Deserialize<'de> for ConsoleApiCalledParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ConsoleApiCalledParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: ConsoleApiCalledParamsType,
#[serde(rename = "args")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub args: Vec<crate::runtime::types::RemoteObject>,
#[serde(rename = "executionContextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub execution_context_id: crate::runtime::types::ExecutionContextId,
#[serde(rename = "timestamp")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub timestamp: crate::runtime::types::Timestamp,
#[serde(rename = "stackTrace")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub stack_trace: Option<crate::runtime::types::StackTrace>,
#[serde(rename = "context")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub context: Option<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ConsoleApiCalledParams {
r#type: fields.r#type,
args: fields.args,
execution_context_id: fields.execution_context_id,
timestamp: fields.timestamp,
stack_trace: fields.stack_trace,
context: fields.context,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ConsoleApiCalled;
impl ydp_core::Event for ConsoleApiCalled {
type Params = ConsoleApiCalledParams;
const METHOD: &'static str = "Runtime.consoleAPICalled";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ExceptionRevokedParams {
#[serde(rename = "reason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub reason: String,
#[serde(rename = "exceptionId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub exception_id: i64,
}
impl<'de> serde::Deserialize<'de> for ExceptionRevokedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ExceptionRevokedParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "reason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub reason: String,
#[serde(rename = "exceptionId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub exception_id: i64,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ExceptionRevokedParams {
reason: fields.reason,
exception_id: fields.exception_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ExceptionRevoked;
impl ydp_core::Event for ExceptionRevoked {
type Params = ExceptionRevokedParams;
const METHOD: &'static str = "Runtime.exceptionRevoked";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ExceptionThrownParams {
#[serde(rename = "timestamp")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub timestamp: crate::runtime::types::Timestamp,
#[serde(rename = "exceptionDetails")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub exception_details: crate::runtime::types::ExceptionDetails,
}
impl<'de> serde::Deserialize<'de> for ExceptionThrownParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ExceptionThrownParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "timestamp")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub timestamp: crate::runtime::types::Timestamp,
#[serde(rename = "exceptionDetails")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub exception_details: crate::runtime::types::ExceptionDetails,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ExceptionThrownParams {
timestamp: fields.timestamp,
exception_details: fields.exception_details,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ExceptionThrown;
impl ydp_core::Event for ExceptionThrown {
type Params = ExceptionThrownParams;
const METHOD: &'static str = "Runtime.exceptionThrown";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ExecutionContextCreatedParams {
#[serde(rename = "context")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub context: crate::runtime::types::ExecutionContextDescription,
}
impl<'de> serde::Deserialize<'de> for ExecutionContextCreatedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ExecutionContextCreatedParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "context")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub context: crate::runtime::types::ExecutionContextDescription,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ExecutionContextCreatedParams {
context: fields.context,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ExecutionContextCreated;
impl ydp_core::Event for ExecutionContextCreated {
type Params = ExecutionContextCreatedParams;
const METHOD: &'static str = "Runtime.executionContextCreated";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ExecutionContextDestroyedParams {
#[serde(rename = "executionContextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub execution_context_id: crate::runtime::types::ExecutionContextId,
#[serde(rename = "executionContextUniqueId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub execution_context_unique_id: String,
}
impl<'de> serde::Deserialize<'de> for ExecutionContextDestroyedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ExecutionContextDestroyedParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "executionContextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub execution_context_id: crate::runtime::types::ExecutionContextId,
#[serde(rename = "executionContextUniqueId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub execution_context_unique_id: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ExecutionContextDestroyedParams {
execution_context_id: fields.execution_context_id,
execution_context_unique_id: fields.execution_context_unique_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ExecutionContextDestroyed;
impl ydp_core::Event for ExecutionContextDestroyed {
type Params = ExecutionContextDestroyedParams;
const METHOD: &'static str = "Runtime.executionContextDestroyed";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct ExecutionContextsClearedParams {}
impl<'de> serde::Deserialize<'de> for ExecutionContextsClearedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ExecutionContextsClearedParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ExecutionContextsClearedParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ExecutionContextsCleared;
impl ydp_core::Event for ExecutionContextsCleared {
type Params = ExecutionContextsClearedParams;
const METHOD: &'static str = "Runtime.executionContextsCleared";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct InspectRequestedParams {
#[serde(rename = "object")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub object: crate::runtime::types::RemoteObject,
#[serde(rename = "hints")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub hints: std::collections::BTreeMap<String, serde_json::Value>,
#[serde(rename = "executionContextId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub execution_context_id: Option<crate::runtime::types::ExecutionContextId>,
}
impl<'de> serde::Deserialize<'de> for InspectRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = InspectRequestedParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "object")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub object: crate::runtime::types::RemoteObject,
#[serde(rename = "hints")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub hints: std::collections::BTreeMap<String, serde_json::Value>,
#[serde(rename = "executionContextId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub execution_context_id: Option<crate::runtime::types::ExecutionContextId>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(InspectRequestedParams {
object: fields.object,
hints: fields.hints,
execution_context_id: fields.execution_context_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct InspectRequested;
impl ydp_core::Event for InspectRequested {
type Params = InspectRequestedParams;
const METHOD: &'static str = "Runtime.inspectRequested";
}