use serde::{Deserialize, Serialize};
pub type ScriptId = String;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SerializationOptions {
pub serialization: SerializationOptionsSerialization,
#[serde(rename = "maxDepth", default, skip_serializing_if = "Option::is_none")]
pub max_depth: Option<i64>,
#[serde(
rename = "additionalParameters",
default,
skip_serializing_if = "Option::is_none"
)]
pub additional_parameters: Option<serde_json::Value>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum SerializationOptionsSerialization {
#[serde(rename = "deep")]
Deep,
#[serde(rename = "json")]
Json,
#[serde(rename = "idOnly")]
IdOnly,
#[serde(untagged)]
Unrecognized(String),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DeepSerializedValue {
pub r#type: DeepSerializedValueType,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<serde_json::Value>,
#[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")]
pub object_id: Option<String>,
#[serde(
rename = "weakLocalObjectReference",
default,
skip_serializing_if = "Option::is_none"
)]
pub weak_local_object_reference: Option<i64>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum DeepSerializedValueType {
#[serde(rename = "undefined")]
Undefined,
#[serde(rename = "null")]
Null,
#[serde(rename = "string")]
String,
#[serde(rename = "number")]
Number,
#[serde(rename = "boolean")]
Boolean,
#[serde(rename = "bigint")]
Bigint,
#[serde(rename = "regexp")]
Regexp,
#[serde(rename = "date")]
Date,
#[serde(rename = "symbol")]
Symbol,
#[serde(rename = "array")]
Array,
#[serde(rename = "object")]
Object,
#[serde(rename = "function")]
Function,
#[serde(rename = "map")]
Map,
#[serde(rename = "set")]
Set,
#[serde(rename = "weakmap")]
Weakmap,
#[serde(rename = "weakset")]
Weakset,
#[serde(rename = "error")]
Error,
#[serde(rename = "proxy")]
Proxy,
#[serde(rename = "promise")]
Promise,
#[serde(rename = "typedarray")]
Typedarray,
#[serde(rename = "arraybuffer")]
Arraybuffer,
#[serde(rename = "node")]
Node,
#[serde(rename = "window")]
Window,
#[serde(rename = "generator")]
Generator,
#[serde(untagged)]
Unrecognized(String),
}
pub type RemoteObjectId = String;
pub type UnserializableValue = String;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RemoteObject {
pub r#type: RemoteObjectType,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub subtype: Option<RemoteObjectSubtype>,
#[serde(rename = "className", default, skip_serializing_if = "Option::is_none")]
pub class_name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<serde_json::Value>,
#[serde(
rename = "unserializableValue",
default,
skip_serializing_if = "Option::is_none"
)]
pub unserializable_value: Option<UnserializableValue>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(
rename = "deepSerializedValue",
default,
skip_serializing_if = "Option::is_none"
)]
pub deep_serialized_value: Option<DeepSerializedValue>,
#[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")]
pub object_id: Option<RemoteObjectId>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub preview: Option<ObjectPreview>,
#[serde(
rename = "customPreview",
default,
skip_serializing_if = "Option::is_none"
)]
pub custom_preview: Option<CustomPreview>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum RemoteObjectType {
#[serde(rename = "object")]
Object,
#[serde(rename = "function")]
Function,
#[serde(rename = "undefined")]
Undefined,
#[serde(rename = "string")]
String,
#[serde(rename = "number")]
Number,
#[serde(rename = "boolean")]
Boolean,
#[serde(rename = "symbol")]
Symbol,
#[serde(rename = "bigint")]
Bigint,
#[serde(untagged)]
Unrecognized(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum RemoteObjectSubtype {
#[serde(rename = "array")]
Array,
#[serde(rename = "null")]
Null,
#[serde(rename = "node")]
Node,
#[serde(rename = "regexp")]
Regexp,
#[serde(rename = "date")]
Date,
#[serde(rename = "map")]
Map,
#[serde(rename = "set")]
Set,
#[serde(rename = "weakmap")]
Weakmap,
#[serde(rename = "weakset")]
Weakset,
#[serde(rename = "iterator")]
Iterator,
#[serde(rename = "generator")]
Generator,
#[serde(rename = "error")]
Error,
#[serde(rename = "proxy")]
Proxy,
#[serde(rename = "promise")]
Promise,
#[serde(rename = "typedarray")]
Typedarray,
#[serde(rename = "arraybuffer")]
Arraybuffer,
#[serde(rename = "dataview")]
Dataview,
#[serde(rename = "webassemblymemory")]
Webassemblymemory,
#[serde(rename = "wasmvalue")]
Wasmvalue,
#[serde(rename = "deferredmodule")]
Deferredmodule,
#[serde(rename = "trustedtype")]
Trustedtype,
#[serde(untagged)]
Unrecognized(String),
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct CustomPreview {
pub header: String,
#[serde(
rename = "bodyGetterId",
default,
skip_serializing_if = "Option::is_none"
)]
pub body_getter_id: Option<RemoteObjectId>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ObjectPreview {
pub r#type: ObjectPreviewType,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub subtype: Option<ObjectPreviewSubtype>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
pub overflow: bool,
pub properties: Vec<PropertyPreview>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub entries: Option<Vec<EntryPreview>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ObjectPreviewType {
#[serde(rename = "object")]
Object,
#[serde(rename = "function")]
Function,
#[serde(rename = "undefined")]
Undefined,
#[serde(rename = "string")]
String,
#[serde(rename = "number")]
Number,
#[serde(rename = "boolean")]
Boolean,
#[serde(rename = "symbol")]
Symbol,
#[serde(rename = "bigint")]
Bigint,
#[serde(untagged)]
Unrecognized(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ObjectPreviewSubtype {
#[serde(rename = "array")]
Array,
#[serde(rename = "null")]
Null,
#[serde(rename = "node")]
Node,
#[serde(rename = "regexp")]
Regexp,
#[serde(rename = "date")]
Date,
#[serde(rename = "map")]
Map,
#[serde(rename = "set")]
Set,
#[serde(rename = "weakmap")]
Weakmap,
#[serde(rename = "weakset")]
Weakset,
#[serde(rename = "iterator")]
Iterator,
#[serde(rename = "generator")]
Generator,
#[serde(rename = "error")]
Error,
#[serde(rename = "proxy")]
Proxy,
#[serde(rename = "promise")]
Promise,
#[serde(rename = "typedarray")]
Typedarray,
#[serde(rename = "arraybuffer")]
Arraybuffer,
#[serde(rename = "dataview")]
Dataview,
#[serde(rename = "webassemblymemory")]
Webassemblymemory,
#[serde(rename = "wasmvalue")]
Wasmvalue,
#[serde(rename = "deferredmodule")]
Deferredmodule,
#[serde(rename = "trustedtype")]
Trustedtype,
#[serde(untagged)]
Unrecognized(String),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PropertyPreview {
pub name: String,
pub r#type: PropertyPreviewType,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
#[serde(
rename = "valuePreview",
default,
skip_serializing_if = "Option::is_none"
)]
pub value_preview: Option<ObjectPreview>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub subtype: Option<PropertyPreviewSubtype>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum PropertyPreviewType {
#[serde(rename = "object")]
Object,
#[serde(rename = "function")]
Function,
#[serde(rename = "undefined")]
Undefined,
#[serde(rename = "string")]
String,
#[serde(rename = "number")]
Number,
#[serde(rename = "boolean")]
Boolean,
#[serde(rename = "symbol")]
Symbol,
#[serde(rename = "accessor")]
Accessor,
#[serde(rename = "bigint")]
Bigint,
#[serde(untagged)]
Unrecognized(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum PropertyPreviewSubtype {
#[serde(rename = "array")]
Array,
#[serde(rename = "null")]
Null,
#[serde(rename = "node")]
Node,
#[serde(rename = "regexp")]
Regexp,
#[serde(rename = "date")]
Date,
#[serde(rename = "map")]
Map,
#[serde(rename = "set")]
Set,
#[serde(rename = "weakmap")]
Weakmap,
#[serde(rename = "weakset")]
Weakset,
#[serde(rename = "iterator")]
Iterator,
#[serde(rename = "generator")]
Generator,
#[serde(rename = "error")]
Error,
#[serde(rename = "proxy")]
Proxy,
#[serde(rename = "promise")]
Promise,
#[serde(rename = "typedarray")]
Typedarray,
#[serde(rename = "arraybuffer")]
Arraybuffer,
#[serde(rename = "dataview")]
Dataview,
#[serde(rename = "webassemblymemory")]
Webassemblymemory,
#[serde(rename = "wasmvalue")]
Wasmvalue,
#[serde(rename = "deferredmodule")]
Deferredmodule,
#[serde(rename = "trustedtype")]
Trustedtype,
#[serde(untagged)]
Unrecognized(String),
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EntryPreview {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<ObjectPreview>,
pub value: ObjectPreview,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PropertyDescriptor {
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<RemoteObject>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub writable: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub get: Option<RemoteObject>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub set: Option<RemoteObject>,
pub configurable: bool,
pub enumerable: bool,
#[serde(rename = "wasThrown", default, skip_serializing_if = "Option::is_none")]
pub was_thrown: Option<bool>,
#[serde(rename = "isOwn", default, skip_serializing_if = "Option::is_none")]
pub is_own: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub symbol: Option<RemoteObject>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct InternalPropertyDescriptor {
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<RemoteObject>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct PrivatePropertyDescriptor {
pub name: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<RemoteObject>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub get: Option<RemoteObject>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub set: Option<RemoteObject>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct CallArgument {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<serde_json::Value>,
#[serde(
rename = "unserializableValue",
default,
skip_serializing_if = "Option::is_none"
)]
pub unserializable_value: Option<UnserializableValue>,
#[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")]
pub object_id: Option<RemoteObjectId>,
}
pub type ExecutionContextId = i64;
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ExecutionContextDescription {
pub id: ExecutionContextId,
pub origin: String,
pub name: String,
#[serde(rename = "uniqueId")]
pub unique_id: String,
#[serde(rename = "auxData", default, skip_serializing_if = "Option::is_none")]
pub aux_data: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ExceptionDetails {
#[serde(rename = "exceptionId")]
pub exception_id: i64,
pub text: String,
#[serde(rename = "lineNumber")]
pub line_number: i64,
#[serde(rename = "columnNumber")]
pub column_number: i64,
#[serde(rename = "scriptId", default, skip_serializing_if = "Option::is_none")]
pub script_id: Option<ScriptId>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[serde(
rename = "stackTrace",
default,
skip_serializing_if = "Option::is_none"
)]
pub stack_trace: Option<StackTrace>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub exception: Option<RemoteObject>,
#[serde(
rename = "executionContextId",
default,
skip_serializing_if = "Option::is_none"
)]
pub execution_context_id: Option<ExecutionContextId>,
#[serde(
rename = "exceptionMetaData",
default,
skip_serializing_if = "Option::is_none"
)]
pub exception_meta_data: Option<serde_json::Value>,
}
pub type Timestamp = f64;
pub type TimeDelta = f64;
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct CallFrame {
#[serde(rename = "functionName")]
pub function_name: String,
#[serde(rename = "scriptId")]
pub script_id: ScriptId,
pub url: String,
#[serde(rename = "lineNumber")]
pub line_number: i64,
#[serde(rename = "columnNumber")]
pub column_number: i64,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct StackTrace {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "callFrames")]
pub call_frames: Vec<CallFrame>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub parent: Option<Box<StackTrace>>,
#[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")]
pub parent_id: Option<StackTraceId>,
}
pub type UniqueDebuggerId = String;
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct StackTraceId {
pub id: String,
#[serde(
rename = "debuggerId",
default,
skip_serializing_if = "Option::is_none"
)]
pub debugger_id: Option<UniqueDebuggerId>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct AwaitPromiseParams {
#[serde(rename = "promiseObjectId")]
pub promise_object_id: RemoteObjectId,
#[serde(
rename = "returnByValue",
default,
skip_serializing_if = "Option::is_none"
)]
pub return_by_value: Option<bool>,
#[serde(
rename = "generatePreview",
default,
skip_serializing_if = "Option::is_none"
)]
pub generate_preview: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AwaitPromiseReturns {
pub result: RemoteObject,
#[serde(
rename = "exceptionDetails",
default,
skip_serializing_if = "Option::is_none"
)]
pub exception_details: Option<ExceptionDetails>,
}
impl crate::typed::Command for AwaitPromiseParams {
const METHOD: &'static str = "Runtime.awaitPromise";
type Returns = AwaitPromiseReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct CallFunctionOnParams {
#[serde(rename = "functionDeclaration")]
pub function_declaration: String,
#[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")]
pub object_id: Option<RemoteObjectId>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub arguments: Option<Vec<CallArgument>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub silent: Option<bool>,
#[serde(
rename = "returnByValue",
default,
skip_serializing_if = "Option::is_none"
)]
pub return_by_value: Option<bool>,
#[serde(
rename = "generatePreview",
default,
skip_serializing_if = "Option::is_none"
)]
pub generate_preview: Option<bool>,
#[serde(
rename = "userGesture",
default,
skip_serializing_if = "Option::is_none"
)]
pub user_gesture: Option<bool>,
#[serde(
rename = "awaitPromise",
default,
skip_serializing_if = "Option::is_none"
)]
pub await_promise: Option<bool>,
#[serde(
rename = "executionContextId",
default,
skip_serializing_if = "Option::is_none"
)]
pub execution_context_id: Option<ExecutionContextId>,
#[serde(
rename = "objectGroup",
default,
skip_serializing_if = "Option::is_none"
)]
pub object_group: Option<String>,
#[serde(
rename = "throwOnSideEffect",
default,
skip_serializing_if = "Option::is_none"
)]
pub throw_on_side_effect: Option<bool>,
#[serde(
rename = "uniqueContextId",
default,
skip_serializing_if = "Option::is_none"
)]
pub unique_context_id: Option<String>,
#[serde(
rename = "serializationOptions",
default,
skip_serializing_if = "Option::is_none"
)]
pub serialization_options: Option<SerializationOptions>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CallFunctionOnReturns {
pub result: RemoteObject,
#[serde(
rename = "exceptionDetails",
default,
skip_serializing_if = "Option::is_none"
)]
pub exception_details: Option<ExceptionDetails>,
}
impl crate::typed::Command for CallFunctionOnParams {
const METHOD: &'static str = "Runtime.callFunctionOn";
type Returns = CallFunctionOnReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct CompileScriptParams {
pub expression: String,
#[serde(rename = "sourceURL")]
pub source_url: String,
#[serde(rename = "persistScript")]
pub persist_script: bool,
#[serde(
rename = "executionContextId",
default,
skip_serializing_if = "Option::is_none"
)]
pub execution_context_id: Option<ExecutionContextId>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct CompileScriptReturns {
#[serde(rename = "scriptId", default, skip_serializing_if = "Option::is_none")]
pub script_id: Option<ScriptId>,
#[serde(
rename = "exceptionDetails",
default,
skip_serializing_if = "Option::is_none"
)]
pub exception_details: Option<ExceptionDetails>,
}
impl crate::typed::Command for CompileScriptParams {
const METHOD: &'static str = "Runtime.compileScript";
type Returns = CompileScriptReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DisableParams {}
impl crate::typed::Command for DisableParams {
const METHOD: &'static str = "Runtime.disable";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DiscardConsoleEntriesParams {}
impl crate::typed::Command for DiscardConsoleEntriesParams {
const METHOD: &'static str = "Runtime.discardConsoleEntries";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EnableParams {}
impl crate::typed::Command for EnableParams {
const METHOD: &'static str = "Runtime.enable";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EvaluateParams {
pub expression: String,
#[serde(
rename = "objectGroup",
default,
skip_serializing_if = "Option::is_none"
)]
pub object_group: Option<String>,
#[serde(
rename = "includeCommandLineAPI",
default,
skip_serializing_if = "Option::is_none"
)]
pub include_command_line_api: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub silent: Option<bool>,
#[serde(rename = "contextId", default, skip_serializing_if = "Option::is_none")]
pub context_id: Option<ExecutionContextId>,
#[serde(
rename = "returnByValue",
default,
skip_serializing_if = "Option::is_none"
)]
pub return_by_value: Option<bool>,
#[serde(
rename = "generatePreview",
default,
skip_serializing_if = "Option::is_none"
)]
pub generate_preview: Option<bool>,
#[serde(
rename = "userGesture",
default,
skip_serializing_if = "Option::is_none"
)]
pub user_gesture: Option<bool>,
#[serde(
rename = "awaitPromise",
default,
skip_serializing_if = "Option::is_none"
)]
pub await_promise: Option<bool>,
#[serde(
rename = "throwOnSideEffect",
default,
skip_serializing_if = "Option::is_none"
)]
pub throw_on_side_effect: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub timeout: Option<TimeDelta>,
#[serde(
rename = "disableBreaks",
default,
skip_serializing_if = "Option::is_none"
)]
pub disable_breaks: Option<bool>,
#[serde(rename = "replMode", default, skip_serializing_if = "Option::is_none")]
pub repl_mode: Option<bool>,
#[serde(
rename = "allowUnsafeEvalBlockedByCSP",
default,
skip_serializing_if = "Option::is_none"
)]
pub allow_unsafe_eval_blocked_by_csp: Option<bool>,
#[serde(
rename = "uniqueContextId",
default,
skip_serializing_if = "Option::is_none"
)]
pub unique_context_id: Option<String>,
#[serde(
rename = "serializationOptions",
default,
skip_serializing_if = "Option::is_none"
)]
pub serialization_options: Option<SerializationOptions>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EvaluateReturns {
pub result: RemoteObject,
#[serde(
rename = "exceptionDetails",
default,
skip_serializing_if = "Option::is_none"
)]
pub exception_details: Option<ExceptionDetails>,
}
impl crate::typed::Command for EvaluateParams {
const METHOD: &'static str = "Runtime.evaluate";
type Returns = EvaluateReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetIsolateIdParams {}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetIsolateIdReturns {
pub id: String,
}
impl crate::typed::Command for GetIsolateIdParams {
const METHOD: &'static str = "Runtime.getIsolateId";
type Returns = GetIsolateIdReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetHeapUsageParams {}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetHeapUsageReturns {
#[serde(rename = "usedSize")]
pub used_size: f64,
#[serde(rename = "totalSize")]
pub total_size: f64,
#[serde(rename = "embedderHeapUsedSize")]
pub embedder_heap_used_size: f64,
#[serde(rename = "backingStorageSize")]
pub backing_storage_size: f64,
}
impl crate::typed::Command for GetHeapUsageParams {
const METHOD: &'static str = "Runtime.getHeapUsage";
type Returns = GetHeapUsageReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetPropertiesParams {
#[serde(rename = "objectId")]
pub object_id: RemoteObjectId,
#[serde(
rename = "ownProperties",
default,
skip_serializing_if = "Option::is_none"
)]
pub own_properties: Option<bool>,
#[serde(
rename = "accessorPropertiesOnly",
default,
skip_serializing_if = "Option::is_none"
)]
pub accessor_properties_only: Option<bool>,
#[serde(
rename = "generatePreview",
default,
skip_serializing_if = "Option::is_none"
)]
pub generate_preview: Option<bool>,
#[serde(
rename = "nonIndexedPropertiesOnly",
default,
skip_serializing_if = "Option::is_none"
)]
pub non_indexed_properties_only: Option<bool>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetPropertiesReturns {
pub result: Vec<PropertyDescriptor>,
#[serde(
rename = "internalProperties",
default,
skip_serializing_if = "Option::is_none"
)]
pub internal_properties: Option<Vec<InternalPropertyDescriptor>>,
#[serde(
rename = "privateProperties",
default,
skip_serializing_if = "Option::is_none"
)]
pub private_properties: Option<Vec<PrivatePropertyDescriptor>>,
#[serde(
rename = "exceptionDetails",
default,
skip_serializing_if = "Option::is_none"
)]
pub exception_details: Option<ExceptionDetails>,
}
impl crate::typed::Command for GetPropertiesParams {
const METHOD: &'static str = "Runtime.getProperties";
type Returns = GetPropertiesReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GlobalLexicalScopeNamesParams {
#[serde(
rename = "executionContextId",
default,
skip_serializing_if = "Option::is_none"
)]
pub execution_context_id: Option<ExecutionContextId>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GlobalLexicalScopeNamesReturns {
pub names: Vec<String>,
}
impl crate::typed::Command for GlobalLexicalScopeNamesParams {
const METHOD: &'static str = "Runtime.globalLexicalScopeNames";
type Returns = GlobalLexicalScopeNamesReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct QueryObjectsParams {
#[serde(rename = "prototypeObjectId")]
pub prototype_object_id: RemoteObjectId,
#[serde(
rename = "objectGroup",
default,
skip_serializing_if = "Option::is_none"
)]
pub object_group: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct QueryObjectsReturns {
pub objects: RemoteObject,
}
impl crate::typed::Command for QueryObjectsParams {
const METHOD: &'static str = "Runtime.queryObjects";
type Returns = QueryObjectsReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ReleaseObjectParams {
#[serde(rename = "objectId")]
pub object_id: RemoteObjectId,
}
impl crate::typed::Command for ReleaseObjectParams {
const METHOD: &'static str = "Runtime.releaseObject";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ReleaseObjectGroupParams {
#[serde(rename = "objectGroup")]
pub object_group: String,
}
impl crate::typed::Command for ReleaseObjectGroupParams {
const METHOD: &'static str = "Runtime.releaseObjectGroup";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct RunIfWaitingForDebuggerParams {}
impl crate::typed::Command for RunIfWaitingForDebuggerParams {
const METHOD: &'static str = "Runtime.runIfWaitingForDebugger";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct RunScriptParams {
#[serde(rename = "scriptId")]
pub script_id: ScriptId,
#[serde(
rename = "executionContextId",
default,
skip_serializing_if = "Option::is_none"
)]
pub execution_context_id: Option<ExecutionContextId>,
#[serde(
rename = "objectGroup",
default,
skip_serializing_if = "Option::is_none"
)]
pub object_group: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub silent: Option<bool>,
#[serde(
rename = "includeCommandLineAPI",
default,
skip_serializing_if = "Option::is_none"
)]
pub include_command_line_api: Option<bool>,
#[serde(
rename = "returnByValue",
default,
skip_serializing_if = "Option::is_none"
)]
pub return_by_value: Option<bool>,
#[serde(
rename = "generatePreview",
default,
skip_serializing_if = "Option::is_none"
)]
pub generate_preview: Option<bool>,
#[serde(
rename = "awaitPromise",
default,
skip_serializing_if = "Option::is_none"
)]
pub await_promise: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RunScriptReturns {
pub result: RemoteObject,
#[serde(
rename = "exceptionDetails",
default,
skip_serializing_if = "Option::is_none"
)]
pub exception_details: Option<ExceptionDetails>,
}
impl crate::typed::Command for RunScriptParams {
const METHOD: &'static str = "Runtime.runScript";
type Returns = RunScriptReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetAsyncCallStackDepthParams {
#[serde(rename = "maxDepth")]
pub max_depth: i64,
}
impl crate::typed::Command for SetAsyncCallStackDepthParams {
const METHOD: &'static str = "Runtime.setAsyncCallStackDepth";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetCustomObjectFormatterEnabledParams {
pub enabled: bool,
}
impl crate::typed::Command for SetCustomObjectFormatterEnabledParams {
const METHOD: &'static str = "Runtime.setCustomObjectFormatterEnabled";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetMaxCallStackSizeToCaptureParams {
pub size: i64,
}
impl crate::typed::Command for SetMaxCallStackSizeToCaptureParams {
const METHOD: &'static str = "Runtime.setMaxCallStackSizeToCapture";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TerminateExecutionParams {}
impl crate::typed::Command for TerminateExecutionParams {
const METHOD: &'static str = "Runtime.terminateExecution";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct AddBindingParams {
pub name: String,
#[serde(
rename = "executionContextId",
default,
skip_serializing_if = "Option::is_none"
)]
pub execution_context_id: Option<ExecutionContextId>,
#[serde(
rename = "executionContextName",
default,
skip_serializing_if = "Option::is_none"
)]
pub execution_context_name: Option<String>,
}
impl crate::typed::Command for AddBindingParams {
const METHOD: &'static str = "Runtime.addBinding";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct RemoveBindingParams {
pub name: String,
}
impl crate::typed::Command for RemoveBindingParams {
const METHOD: &'static str = "Runtime.removeBinding";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetExceptionDetailsParams {
#[serde(rename = "errorObjectId")]
pub error_object_id: RemoteObjectId,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetExceptionDetailsReturns {
#[serde(
rename = "exceptionDetails",
default,
skip_serializing_if = "Option::is_none"
)]
pub exception_details: Option<ExceptionDetails>,
}
impl crate::typed::Command for GetExceptionDetailsParams {
const METHOD: &'static str = "Runtime.getExceptionDetails";
type Returns = GetExceptionDetailsReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct BindingCalledEvent {
pub name: String,
pub payload: String,
#[serde(rename = "executionContextId")]
pub execution_context_id: ExecutionContextId,
}
impl crate::typed::Event for BindingCalledEvent {
const METHOD: &'static str = "Runtime.bindingCalled";
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ConsoleApiCalledEvent {
pub r#type: ConsoleApiCalledType,
pub args: Vec<RemoteObject>,
#[serde(rename = "executionContextId")]
pub execution_context_id: ExecutionContextId,
pub timestamp: Timestamp,
#[serde(
rename = "stackTrace",
default,
skip_serializing_if = "Option::is_none"
)]
pub stack_trace: Option<StackTrace>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub context: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ConsoleApiCalledType {
#[serde(rename = "log")]
Log,
#[serde(rename = "debug")]
Debug,
#[serde(rename = "info")]
Info,
#[serde(rename = "error")]
Error,
#[serde(rename = "warning")]
Warning,
#[serde(rename = "dir")]
Dir,
#[serde(rename = "dirxml")]
Dirxml,
#[serde(rename = "table")]
Table,
#[serde(rename = "trace")]
Trace,
#[serde(rename = "clear")]
Clear,
#[serde(rename = "startGroup")]
StartGroup,
#[serde(rename = "startGroupCollapsed")]
StartGroupCollapsed,
#[serde(rename = "endGroup")]
EndGroup,
#[serde(rename = "assert")]
Assert,
#[serde(rename = "profile")]
Profile,
#[serde(rename = "profileEnd")]
ProfileEnd,
#[serde(rename = "count")]
Count,
#[serde(rename = "timeEnd")]
TimeEnd,
#[serde(untagged)]
Unrecognized(String),
}
impl crate::typed::Event for ConsoleApiCalledEvent {
const METHOD: &'static str = "Runtime.consoleAPICalled";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ExceptionRevokedEvent {
pub reason: String,
#[serde(rename = "exceptionId")]
pub exception_id: i64,
}
impl crate::typed::Event for ExceptionRevokedEvent {
const METHOD: &'static str = "Runtime.exceptionRevoked";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ExceptionThrownEvent {
pub timestamp: Timestamp,
#[serde(rename = "exceptionDetails")]
pub exception_details: ExceptionDetails,
}
impl crate::typed::Event for ExceptionThrownEvent {
const METHOD: &'static str = "Runtime.exceptionThrown";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ExecutionContextCreatedEvent {
pub context: ExecutionContextDescription,
}
impl crate::typed::Event for ExecutionContextCreatedEvent {
const METHOD: &'static str = "Runtime.executionContextCreated";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ExecutionContextDestroyedEvent {
#[serde(rename = "executionContextId")]
pub execution_context_id: ExecutionContextId,
#[serde(rename = "executionContextUniqueId")]
pub execution_context_unique_id: String,
}
impl crate::typed::Event for ExecutionContextDestroyedEvent {
const METHOD: &'static str = "Runtime.executionContextDestroyed";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ExecutionContextsClearedEvent {}
impl crate::typed::Event for ExecutionContextsClearedEvent {
const METHOD: &'static str = "Runtime.executionContextsCleared";
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct InspectRequestedEvent {
pub object: RemoteObject,
pub hints: serde_json::Value,
#[serde(
rename = "executionContextId",
default,
skip_serializing_if = "Option::is_none"
)]
pub execution_context_id: Option<ExecutionContextId>,
}
impl crate::typed::Event for InspectRequestedEvent {
const METHOD: &'static str = "Runtime.inspectRequested";
}