use serde::{Serialize, Deserialize};
use serde_json::Value as JsonValue;
pub type HeapSnapshotObjectId = String;
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SamplingHeapProfileNode {
pub callFrame: crate::runtime::CallFrame,
pub selfSize: f64,
pub id: u64,
pub children: Vec<SamplingHeapProfileNode>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SamplingHeapProfileSample {
pub size: f64,
pub nodeId: u64,
pub ordinal: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SamplingHeapProfile {
pub head: SamplingHeapProfileNode,
pub samples: Vec<SamplingHeapProfileSample>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AddInspectedHeapObjectParams {
pub heapObjectId: HeapSnapshotObjectId,
}
impl AddInspectedHeapObjectParams { pub const METHOD: &'static str = "HeapProfiler.addInspectedHeapObject"; }
impl crate::CdpCommand for AddInspectedHeapObjectParams {
const METHOD: &'static str = "HeapProfiler.addInspectedHeapObject";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct CollectGarbageParams {}
impl CollectGarbageParams { pub const METHOD: &'static str = "HeapProfiler.collectGarbage"; }
impl crate::CdpCommand for CollectGarbageParams {
const METHOD: &'static str = "HeapProfiler.collectGarbage";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct DisableParams {}
impl DisableParams { pub const METHOD: &'static str = "HeapProfiler.disable"; }
impl crate::CdpCommand for DisableParams {
const METHOD: &'static str = "HeapProfiler.disable";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct EnableParams {}
impl EnableParams { pub const METHOD: &'static str = "HeapProfiler.enable"; }
impl crate::CdpCommand for EnableParams {
const METHOD: &'static str = "HeapProfiler.enable";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetHeapObjectIdParams {
pub objectId: crate::runtime::RemoteObjectId,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetHeapObjectIdReturns {
pub heapSnapshotObjectId: HeapSnapshotObjectId,
}
impl GetHeapObjectIdParams { pub const METHOD: &'static str = "HeapProfiler.getHeapObjectId"; }
impl crate::CdpCommand for GetHeapObjectIdParams {
const METHOD: &'static str = "HeapProfiler.getHeapObjectId";
type Response = GetHeapObjectIdReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetObjectByHeapObjectIdParams {
pub objectId: HeapSnapshotObjectId,
#[serde(skip_serializing_if = "Option::is_none")]
pub objectGroup: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetObjectByHeapObjectIdReturns {
pub result: crate::runtime::RemoteObject,
}
impl GetObjectByHeapObjectIdParams { pub const METHOD: &'static str = "HeapProfiler.getObjectByHeapObjectId"; }
impl crate::CdpCommand for GetObjectByHeapObjectIdParams {
const METHOD: &'static str = "HeapProfiler.getObjectByHeapObjectId";
type Response = GetObjectByHeapObjectIdReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetSamplingProfileReturns {
pub profile: SamplingHeapProfile,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct GetSamplingProfileParams {}
impl GetSamplingProfileParams { pub const METHOD: &'static str = "HeapProfiler.getSamplingProfile"; }
impl crate::CdpCommand for GetSamplingProfileParams {
const METHOD: &'static str = "HeapProfiler.getSamplingProfile";
type Response = GetSamplingProfileReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct StartSamplingParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub samplingInterval: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stackDepth: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub includeObjectsCollectedByMajorGC: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub includeObjectsCollectedByMinorGC: Option<bool>,
}
impl StartSamplingParams { pub const METHOD: &'static str = "HeapProfiler.startSampling"; }
impl crate::CdpCommand for StartSamplingParams {
const METHOD: &'static str = "HeapProfiler.startSampling";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct StartTrackingHeapObjectsParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub trackAllocations: Option<bool>,
}
impl StartTrackingHeapObjectsParams { pub const METHOD: &'static str = "HeapProfiler.startTrackingHeapObjects"; }
impl crate::CdpCommand for StartTrackingHeapObjectsParams {
const METHOD: &'static str = "HeapProfiler.startTrackingHeapObjects";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct StopSamplingReturns {
pub profile: SamplingHeapProfile,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct StopSamplingParams {}
impl StopSamplingParams { pub const METHOD: &'static str = "HeapProfiler.stopSampling"; }
impl crate::CdpCommand for StopSamplingParams {
const METHOD: &'static str = "HeapProfiler.stopSampling";
type Response = StopSamplingReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct StopTrackingHeapObjectsParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub reportProgress: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub treatGlobalObjectsAsRoots: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub captureNumericValue: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub exposeInternals: Option<bool>,
}
impl StopTrackingHeapObjectsParams { pub const METHOD: &'static str = "HeapProfiler.stopTrackingHeapObjects"; }
impl crate::CdpCommand for StopTrackingHeapObjectsParams {
const METHOD: &'static str = "HeapProfiler.stopTrackingHeapObjects";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TakeHeapSnapshotParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub reportProgress: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub treatGlobalObjectsAsRoots: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub captureNumericValue: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub exposeInternals: Option<bool>,
}
impl TakeHeapSnapshotParams { pub const METHOD: &'static str = "HeapProfiler.takeHeapSnapshot"; }
impl crate::CdpCommand for TakeHeapSnapshotParams {
const METHOD: &'static str = "HeapProfiler.takeHeapSnapshot";
type Response = crate::EmptyReturns;
}