#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct EndParams {}
impl<'de> serde::Deserialize<'de> for EndParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EndParams;
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(EndParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct End;
#[derive(Debug, Clone, serde::Serialize)]
pub struct EndResponse {}
impl<'de> serde::Deserialize<'de> for EndResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EndResponse;
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(EndResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for End {
type Params = EndParams;
type Response = EndResponse;
const METHOD: &'static str = "Tracing.end";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct GetCategoriesParams {}
impl<'de> serde::Deserialize<'de> for GetCategoriesParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetCategoriesParams;
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(GetCategoriesParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetCategories;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetCategoriesResponse {
#[serde(rename = "categories")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub categories: Vec<String>,
}
impl<'de> serde::Deserialize<'de> for GetCategoriesResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetCategoriesResponse;
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 = "categories")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub categories: Vec<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetCategoriesResponse {
categories: fields.categories,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetCategories {
type Params = GetCategoriesParams;
type Response = GetCategoriesResponse;
const METHOD: &'static str = "Tracing.getCategories";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct GetTrackEventDescriptorParams {}
impl<'de> serde::Deserialize<'de> for GetTrackEventDescriptorParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetTrackEventDescriptorParams;
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(GetTrackEventDescriptorParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetTrackEventDescriptor;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetTrackEventDescriptorResponse {
#[serde(rename = "descriptor")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub descriptor: String,
}
impl<'de> serde::Deserialize<'de> for GetTrackEventDescriptorResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetTrackEventDescriptorResponse;
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 = "descriptor")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub descriptor: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetTrackEventDescriptorResponse {
descriptor: fields.descriptor,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetTrackEventDescriptor {
type Params = GetTrackEventDescriptorParams;
type Response = GetTrackEventDescriptorResponse;
const METHOD: &'static str = "Tracing.getTrackEventDescriptor";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct RecordClockSyncMarkerParams {
#[serde(rename = "syncId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub sync_id: String,
}
impl<'de> serde::Deserialize<'de> for RecordClockSyncMarkerParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = RecordClockSyncMarkerParams;
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 = "syncId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub sync_id: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(RecordClockSyncMarkerParams {
sync_id: fields.sync_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct RecordClockSyncMarker;
#[derive(Debug, Clone, serde::Serialize)]
pub struct RecordClockSyncMarkerResponse {}
impl<'de> serde::Deserialize<'de> for RecordClockSyncMarkerResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = RecordClockSyncMarkerResponse;
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(RecordClockSyncMarkerResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for RecordClockSyncMarker {
type Params = RecordClockSyncMarkerParams;
type Response = RecordClockSyncMarkerResponse;
const METHOD: &'static str = "Tracing.recordClockSyncMarker";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct RequestMemoryDumpParams {
#[serde(rename = "deterministic")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub deterministic: Option<bool>,
#[serde(rename = "levelOfDetail")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub level_of_detail: Option<crate::tracing::types::MemoryDumpLevelOfDetail>,
}
impl<'de> serde::Deserialize<'de> for RequestMemoryDumpParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = RequestMemoryDumpParams;
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 = "deterministic")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub deterministic: Option<bool>,
#[serde(rename = "levelOfDetail")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub level_of_detail: Option<crate::tracing::types::MemoryDumpLevelOfDetail>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(RequestMemoryDumpParams {
deterministic: fields.deterministic,
level_of_detail: fields.level_of_detail,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct RequestMemoryDump;
#[derive(Debug, Clone, serde::Serialize)]
pub struct RequestMemoryDumpResponse {
#[serde(rename = "dumpGuid")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub dump_guid: String,
#[serde(rename = "success")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub success: bool,
}
impl<'de> serde::Deserialize<'de> for RequestMemoryDumpResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = RequestMemoryDumpResponse;
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 = "dumpGuid")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub dump_guid: String,
#[serde(rename = "success")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub success: bool,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(RequestMemoryDumpResponse {
dump_guid: fields.dump_guid,
success: fields.success,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for RequestMemoryDump {
type Params = RequestMemoryDumpParams;
type Response = RequestMemoryDumpResponse;
const METHOD: &'static str = "Tracing.requestMemoryDump";
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum StartParamsTransferMode {
ReportEvents,
ReturnAsStream,
Unknown(String),
}
impl StartParamsTransferMode {
pub fn as_str(&self) -> &str {
match self {
Self::ReportEvents => "ReportEvents",
Self::ReturnAsStream => "ReturnAsStream",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for StartParamsTransferMode {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for StartParamsTransferMode {
fn from(value: String) -> Self {
match value.as_str() {
"ReportEvents" => StartParamsTransferMode::ReportEvents,
"ReturnAsStream" => StartParamsTransferMode::ReturnAsStream,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for StartParamsTransferMode {
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 StartParamsTransferMode {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = StartParamsTransferMode;
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 {
"ReportEvents" => StartParamsTransferMode::ReportEvents,
"ReturnAsStream" => StartParamsTransferMode::ReturnAsStream,
_ => StartParamsTransferMode::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(StartParamsTransferMode::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct StartParams {
#[serde(rename = "categories")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub categories: Option<String>,
#[serde(rename = "options")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub options: Option<String>,
#[serde(rename = "bufferUsageReportingInterval")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub buffer_usage_reporting_interval: Option<ydp_core::FiniteF64>,
#[serde(rename = "transferMode")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub transfer_mode: Option<StartParamsTransferMode>,
#[serde(rename = "streamFormat")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub stream_format: Option<crate::tracing::types::StreamFormat>,
#[serde(rename = "streamCompression")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub stream_compression: Option<crate::tracing::types::StreamCompression>,
#[serde(rename = "traceConfig")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub trace_config: Option<crate::tracing::types::TraceConfig>,
#[serde(rename = "perfettoConfig")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub perfetto_config: Option<String>,
#[serde(rename = "tracingBackend")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub tracing_backend: Option<crate::tracing::types::TracingBackend>,
#[serde(rename = "screenshotMaxSize")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub screenshot_max_size: Option<i64>,
#[serde(rename = "screenshotMaxCount")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub screenshot_max_count: Option<i64>,
}
impl<'de> serde::Deserialize<'de> for StartParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = StartParams;
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 = "categories")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub categories: Option<String>,
#[serde(rename = "options")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub options: Option<String>,
#[serde(rename = "bufferUsageReportingInterval")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub buffer_usage_reporting_interval: Option<ydp_core::FiniteF64>,
#[serde(rename = "transferMode")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub transfer_mode: Option<StartParamsTransferMode>,
#[serde(rename = "streamFormat")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub stream_format: Option<crate::tracing::types::StreamFormat>,
#[serde(rename = "streamCompression")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub stream_compression: Option<crate::tracing::types::StreamCompression>,
#[serde(rename = "traceConfig")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub trace_config: Option<crate::tracing::types::TraceConfig>,
#[serde(rename = "perfettoConfig")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub perfetto_config: Option<String>,
#[serde(rename = "tracingBackend")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub tracing_backend: Option<crate::tracing::types::TracingBackend>,
#[serde(rename = "screenshotMaxSize")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub screenshot_max_size: Option<i64>,
#[serde(rename = "screenshotMaxCount")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub screenshot_max_count: Option<i64>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(StartParams {
categories: fields.categories,
options: fields.options,
buffer_usage_reporting_interval: fields.buffer_usage_reporting_interval,
transfer_mode: fields.transfer_mode,
stream_format: fields.stream_format,
stream_compression: fields.stream_compression,
trace_config: fields.trace_config,
perfetto_config: fields.perfetto_config,
tracing_backend: fields.tracing_backend,
screenshot_max_size: fields.screenshot_max_size,
screenshot_max_count: fields.screenshot_max_count,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct Start;
#[derive(Debug, Clone, serde::Serialize)]
pub struct StartResponse {}
impl<'de> serde::Deserialize<'de> for StartResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = StartResponse;
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(StartResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for Start {
type Params = StartParams;
type Response = StartResponse;
const METHOD: &'static str = "Tracing.start";
}