#[derive(Debug, Clone, serde::Serialize)]
pub struct AddHeapSnapshotChunkParams {
#[serde(rename = "chunk")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub chunk: String,
}
impl<'de> serde::Deserialize<'de> for AddHeapSnapshotChunkParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = AddHeapSnapshotChunkParams;
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 = "chunk")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub chunk: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(AddHeapSnapshotChunkParams {
chunk: fields.chunk,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct AddHeapSnapshotChunk;
impl ydp_core::Event for AddHeapSnapshotChunk {
type Params = AddHeapSnapshotChunkParams;
const METHOD: &'static str = "HeapProfiler.addHeapSnapshotChunk";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct HeapStatsUpdateParams {
#[serde(rename = "statsUpdate")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub stats_update: Vec<i64>,
}
impl<'de> serde::Deserialize<'de> for HeapStatsUpdateParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = HeapStatsUpdateParams;
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 = "statsUpdate")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub stats_update: Vec<i64>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(HeapStatsUpdateParams {
stats_update: fields.stats_update,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct HeapStatsUpdate;
impl ydp_core::Event for HeapStatsUpdate {
type Params = HeapStatsUpdateParams;
const METHOD: &'static str = "HeapProfiler.heapStatsUpdate";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct LastSeenObjectIdParams {
#[serde(rename = "lastSeenObjectId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub last_seen_object_id: i64,
#[serde(rename = "timestamp")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub timestamp: ydp_core::FiniteF64,
}
impl<'de> serde::Deserialize<'de> for LastSeenObjectIdParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = LastSeenObjectIdParams;
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 = "lastSeenObjectId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub last_seen_object_id: i64,
#[serde(rename = "timestamp")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub timestamp: ydp_core::FiniteF64,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(LastSeenObjectIdParams {
last_seen_object_id: fields.last_seen_object_id,
timestamp: fields.timestamp,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct LastSeenObjectId;
impl ydp_core::Event for LastSeenObjectId {
type Params = LastSeenObjectIdParams;
const METHOD: &'static str = "HeapProfiler.lastSeenObjectId";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ReportHeapSnapshotProgressParams {
#[serde(rename = "done")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub done: i64,
#[serde(rename = "total")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub total: i64,
#[serde(rename = "finished")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub finished: Option<bool>,
}
impl<'de> serde::Deserialize<'de> for ReportHeapSnapshotProgressParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ReportHeapSnapshotProgressParams;
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 = "done")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub done: i64,
#[serde(rename = "total")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub total: i64,
#[serde(rename = "finished")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub finished: Option<bool>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ReportHeapSnapshotProgressParams {
done: fields.done,
total: fields.total,
finished: fields.finished,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ReportHeapSnapshotProgress;
impl ydp_core::Event for ReportHeapSnapshotProgress {
type Params = ReportHeapSnapshotProgressParams;
const METHOD: &'static str = "HeapProfiler.reportHeapSnapshotProgress";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct ResetProfilesParams {}
impl<'de> serde::Deserialize<'de> for ResetProfilesParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ResetProfilesParams;
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(ResetProfilesParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ResetProfiles;
impl ydp_core::Event for ResetProfiles {
type Params = ResetProfilesParams;
const METHOD: &'static str = "HeapProfiler.resetProfiles";
}