#[derive(Debug, Clone, serde::Serialize)]
pub struct ConsoleProfileFinishedParams {
#[serde(rename = "id")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub id: String,
#[serde(rename = "location")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub location: crate::debugger::types::Location,
#[serde(rename = "profile")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub profile: crate::profiler::types::Profile,
#[serde(rename = "title")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub title: Option<String>,
}
impl<'de> serde::Deserialize<'de> for ConsoleProfileFinishedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ConsoleProfileFinishedParams;
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 = "id")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub id: String,
#[serde(rename = "location")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub location: crate::debugger::types::Location,
#[serde(rename = "profile")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub profile: crate::profiler::types::Profile,
#[serde(rename = "title")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub title: Option<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ConsoleProfileFinishedParams {
id: fields.id,
location: fields.location,
profile: fields.profile,
title: fields.title,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ConsoleProfileFinished;
impl ydp_core::Event for ConsoleProfileFinished {
type Params = ConsoleProfileFinishedParams;
const METHOD: &'static str = "Profiler.consoleProfileFinished";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ConsoleProfileStartedParams {
#[serde(rename = "id")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub id: String,
#[serde(rename = "location")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub location: crate::debugger::types::Location,
#[serde(rename = "title")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub title: Option<String>,
}
impl<'de> serde::Deserialize<'de> for ConsoleProfileStartedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ConsoleProfileStartedParams;
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 = "id")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub id: String,
#[serde(rename = "location")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub location: crate::debugger::types::Location,
#[serde(rename = "title")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub title: Option<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ConsoleProfileStartedParams {
id: fields.id,
location: fields.location,
title: fields.title,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ConsoleProfileStarted;
impl ydp_core::Event for ConsoleProfileStarted {
type Params = ConsoleProfileStartedParams;
const METHOD: &'static str = "Profiler.consoleProfileStarted";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct PreciseCoverageDeltaUpdateParams {
#[serde(rename = "timestamp")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub timestamp: ydp_core::FiniteF64,
#[serde(rename = "occasion")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub occasion: String,
#[serde(rename = "result")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub result: Vec<crate::profiler::types::ScriptCoverage>,
}
impl<'de> serde::Deserialize<'de> for PreciseCoverageDeltaUpdateParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = PreciseCoverageDeltaUpdateParams;
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: ydp_core::FiniteF64,
#[serde(rename = "occasion")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub occasion: String,
#[serde(rename = "result")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub result: Vec<crate::profiler::types::ScriptCoverage>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(PreciseCoverageDeltaUpdateParams {
timestamp: fields.timestamp,
occasion: fields.occasion,
result: fields.result,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct PreciseCoverageDeltaUpdate;
impl ydp_core::Event for PreciseCoverageDeltaUpdate {
type Params = PreciseCoverageDeltaUpdateParams;
const METHOD: &'static str = "Profiler.preciseCoverageDeltaUpdate";
}