#[derive(Debug, Clone, serde::Serialize)]
pub struct PrefetchStatusUpdatedParams {
#[serde(rename = "key")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub key: crate::preload::types::PreloadingAttemptKey,
#[serde(rename = "pipelineId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub pipeline_id: crate::preload::types::PreloadPipelineId,
#[serde(rename = "initiatingFrameId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub initiating_frame_id: crate::page::types::FrameId,
#[serde(rename = "prefetchUrl")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub prefetch_url: String,
#[serde(rename = "status")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub status: crate::preload::types::PreloadingStatus,
#[serde(rename = "prefetchStatus")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub prefetch_status: crate::preload::types::PrefetchStatus,
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::network::types::RequestId,
}
impl<'de> serde::Deserialize<'de> for PrefetchStatusUpdatedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = PrefetchStatusUpdatedParams;
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 = "key")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub key: crate::preload::types::PreloadingAttemptKey,
#[serde(rename = "pipelineId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub pipeline_id: crate::preload::types::PreloadPipelineId,
#[serde(rename = "initiatingFrameId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub initiating_frame_id: crate::page::types::FrameId,
#[serde(rename = "prefetchUrl")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub prefetch_url: String,
#[serde(rename = "status")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub status: crate::preload::types::PreloadingStatus,
#[serde(rename = "prefetchStatus")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub prefetch_status: crate::preload::types::PrefetchStatus,
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::network::types::RequestId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(PrefetchStatusUpdatedParams {
key: fields.key,
pipeline_id: fields.pipeline_id,
initiating_frame_id: fields.initiating_frame_id,
prefetch_url: fields.prefetch_url,
status: fields.status,
prefetch_status: fields.prefetch_status,
request_id: fields.request_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct PrefetchStatusUpdated;
impl ydp_core::Event for PrefetchStatusUpdated {
type Params = PrefetchStatusUpdatedParams;
const METHOD: &'static str = "Preload.prefetchStatusUpdated";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct PreloadEnabledStateUpdatedParams {
#[serde(rename = "disabledByPreference")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub disabled_by_preference: bool,
#[serde(rename = "disabledByDataSaver")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub disabled_by_data_saver: bool,
#[serde(rename = "disabledByBatterySaver")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub disabled_by_battery_saver: bool,
#[serde(rename = "disabledByHoldbackPrefetchSpeculationRules")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub disabled_by_holdback_prefetch_speculation_rules: bool,
#[serde(rename = "disabledByHoldbackPrerenderSpeculationRules")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub disabled_by_holdback_prerender_speculation_rules: bool,
}
impl<'de> serde::Deserialize<'de> for PreloadEnabledStateUpdatedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = PreloadEnabledStateUpdatedParams;
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 = "disabledByPreference")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub disabled_by_preference: bool,
#[serde(rename = "disabledByDataSaver")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub disabled_by_data_saver: bool,
#[serde(rename = "disabledByBatterySaver")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub disabled_by_battery_saver: bool,
#[serde(rename = "disabledByHoldbackPrefetchSpeculationRules")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub disabled_by_holdback_prefetch_speculation_rules: bool,
#[serde(rename = "disabledByHoldbackPrerenderSpeculationRules")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub disabled_by_holdback_prerender_speculation_rules: bool,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(PreloadEnabledStateUpdatedParams {
disabled_by_preference: fields.disabled_by_preference,
disabled_by_data_saver: fields.disabled_by_data_saver,
disabled_by_battery_saver: fields.disabled_by_battery_saver,
disabled_by_holdback_prefetch_speculation_rules: fields
.disabled_by_holdback_prefetch_speculation_rules,
disabled_by_holdback_prerender_speculation_rules: fields
.disabled_by_holdback_prerender_speculation_rules,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct PreloadEnabledStateUpdated;
impl ydp_core::Event for PreloadEnabledStateUpdated {
type Params = PreloadEnabledStateUpdatedParams;
const METHOD: &'static str = "Preload.preloadEnabledStateUpdated";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct PreloadingAttemptSourcesUpdatedParams {
#[serde(rename = "loaderId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub loader_id: crate::network::types::LoaderId,
#[serde(rename = "preloadingAttemptSources")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub preloading_attempt_sources: Vec<crate::preload::types::PreloadingAttemptSource>,
}
impl<'de> serde::Deserialize<'de> for PreloadingAttemptSourcesUpdatedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = PreloadingAttemptSourcesUpdatedParams;
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 = "loaderId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub loader_id: crate::network::types::LoaderId,
#[serde(rename = "preloadingAttemptSources")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub preloading_attempt_sources:
Vec<crate::preload::types::PreloadingAttemptSource>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(PreloadingAttemptSourcesUpdatedParams {
loader_id: fields.loader_id,
preloading_attempt_sources: fields.preloading_attempt_sources,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct PreloadingAttemptSourcesUpdated;
impl ydp_core::Event for PreloadingAttemptSourcesUpdated {
type Params = PreloadingAttemptSourcesUpdatedParams;
const METHOD: &'static str = "Preload.preloadingAttemptSourcesUpdated";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct PrerenderStatusUpdatedParams {
#[serde(rename = "key")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub key: crate::preload::types::PreloadingAttemptKey,
#[serde(rename = "pipelineId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub pipeline_id: crate::preload::types::PreloadPipelineId,
#[serde(rename = "status")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub status: crate::preload::types::PreloadingStatus,
#[serde(rename = "prerenderStatus")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub prerender_status: Option<crate::preload::types::PrerenderFinalStatus>,
#[serde(rename = "disallowedMojoInterface")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub disallowed_mojo_interface: Option<String>,
#[serde(rename = "mismatchedHeaders")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub mismatched_headers: Option<Vec<crate::preload::types::PrerenderMismatchedHeaders>>,
}
impl<'de> serde::Deserialize<'de> for PrerenderStatusUpdatedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = PrerenderStatusUpdatedParams;
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 = "key")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub key: crate::preload::types::PreloadingAttemptKey,
#[serde(rename = "pipelineId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub pipeline_id: crate::preload::types::PreloadPipelineId,
#[serde(rename = "status")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub status: crate::preload::types::PreloadingStatus,
#[serde(rename = "prerenderStatus")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub prerender_status: Option<crate::preload::types::PrerenderFinalStatus>,
#[serde(rename = "disallowedMojoInterface")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub disallowed_mojo_interface: Option<String>,
#[serde(rename = "mismatchedHeaders")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub mismatched_headers:
Option<Vec<crate::preload::types::PrerenderMismatchedHeaders>>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(PrerenderStatusUpdatedParams {
key: fields.key,
pipeline_id: fields.pipeline_id,
status: fields.status,
prerender_status: fields.prerender_status,
disallowed_mojo_interface: fields.disallowed_mojo_interface,
mismatched_headers: fields.mismatched_headers,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct PrerenderStatusUpdated;
impl ydp_core::Event for PrerenderStatusUpdated {
type Params = PrerenderStatusUpdatedParams;
const METHOD: &'static str = "Preload.prerenderStatusUpdated";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct RuleSetRemovedParams {
#[serde(rename = "id")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub id: crate::preload::types::RuleSetId,
}
impl<'de> serde::Deserialize<'de> for RuleSetRemovedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = RuleSetRemovedParams;
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: crate::preload::types::RuleSetId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(RuleSetRemovedParams { id: fields.id })
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct RuleSetRemoved;
impl ydp_core::Event for RuleSetRemoved {
type Params = RuleSetRemovedParams;
const METHOD: &'static str = "Preload.ruleSetRemoved";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct RuleSetUpdatedParams {
#[serde(rename = "ruleSet")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub rule_set: crate::preload::types::RuleSet,
}
impl<'de> serde::Deserialize<'de> for RuleSetUpdatedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = RuleSetUpdatedParams;
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 = "ruleSet")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub rule_set: crate::preload::types::RuleSet,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(RuleSetUpdatedParams {
rule_set: fields.rule_set,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct RuleSetUpdated;
impl ydp_core::Event for RuleSetUpdated {
type Params = RuleSetUpdatedParams;
const METHOD: &'static str = "Preload.ruleSetUpdated";
}