#[derive(Debug, Clone, serde::Serialize)]
pub struct AddRuleParams {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "ruleText")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub rule_text: String,
#[serde(rename = "location")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub location: crate::css::types::SourceRange,
#[serde(rename = "nodeForPropertySyntaxValidation")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub node_for_property_syntax_validation: Option<crate::dom::types::NodeId>,
}
impl<'de> serde::Deserialize<'de> for AddRuleParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = AddRuleParams;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "ruleText")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub rule_text: String,
#[serde(rename = "location")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub location: crate::css::types::SourceRange,
#[serde(rename = "nodeForPropertySyntaxValidation")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub node_for_property_syntax_validation: Option<crate::dom::types::NodeId>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(AddRuleParams {
style_sheet_id: fields.style_sheet_id,
rule_text: fields.rule_text,
location: fields.location,
node_for_property_syntax_validation: fields.node_for_property_syntax_validation,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct AddRule;
#[derive(Debug, Clone, serde::Serialize)]
pub struct AddRuleResponse {
#[serde(rename = "rule")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub rule: crate::css::types::CssRule,
}
impl<'de> serde::Deserialize<'de> for AddRuleResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = AddRuleResponse;
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 = "rule")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub rule: crate::css::types::CssRule,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(AddRuleResponse { rule: fields.rule })
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for AddRule {
type Params = AddRuleParams;
type Response = AddRuleResponse;
const METHOD: &'static str = "CSS.addRule";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct CollectClassNamesParams {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
}
impl<'de> serde::Deserialize<'de> for CollectClassNamesParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CollectClassNamesParams;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(CollectClassNamesParams {
style_sheet_id: fields.style_sheet_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct CollectClassNames;
#[derive(Debug, Clone, serde::Serialize)]
pub struct CollectClassNamesResponse {
#[serde(rename = "classNames")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub class_names: Vec<String>,
}
impl<'de> serde::Deserialize<'de> for CollectClassNamesResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CollectClassNamesResponse;
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 = "classNames")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub class_names: Vec<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(CollectClassNamesResponse {
class_names: fields.class_names,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for CollectClassNames {
type Params = CollectClassNamesParams;
type Response = CollectClassNamesResponse;
const METHOD: &'static str = "CSS.collectClassNames";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct CreateStyleSheetParams {
#[serde(rename = "frameId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub frame_id: crate::page::types::FrameId,
#[serde(rename = "force")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub force: Option<bool>,
}
impl<'de> serde::Deserialize<'de> for CreateStyleSheetParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CreateStyleSheetParams;
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 = "frameId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub frame_id: crate::page::types::FrameId,
#[serde(rename = "force")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub force: Option<bool>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(CreateStyleSheetParams {
frame_id: fields.frame_id,
force: fields.force,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct CreateStyleSheet;
#[derive(Debug, Clone, serde::Serialize)]
pub struct CreateStyleSheetResponse {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
}
impl<'de> serde::Deserialize<'de> for CreateStyleSheetResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CreateStyleSheetResponse;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(CreateStyleSheetResponse {
style_sheet_id: fields.style_sheet_id,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for CreateStyleSheet {
type Params = CreateStyleSheetParams;
type Response = CreateStyleSheetResponse;
const METHOD: &'static str = "CSS.createStyleSheet";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct DisableParams {}
impl<'de> serde::Deserialize<'de> for DisableParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DisableParams;
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(DisableParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct Disable;
#[derive(Debug, Clone, serde::Serialize)]
pub struct DisableResponse {}
impl<'de> serde::Deserialize<'de> for DisableResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DisableResponse;
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(DisableResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for Disable {
type Params = DisableParams;
type Response = DisableResponse;
const METHOD: &'static str = "CSS.disable";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct EnableParams {}
impl<'de> serde::Deserialize<'de> for EnableParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EnableParams;
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(EnableParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct Enable;
#[derive(Debug, Clone, serde::Serialize)]
pub struct EnableResponse {}
impl<'de> serde::Deserialize<'de> for EnableResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EnableResponse;
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(EnableResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for Enable {
type Params = EnableParams;
type Response = EnableResponse;
const METHOD: &'static str = "CSS.enable";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ForcePseudoStateParams {
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
#[serde(rename = "forcedPseudoClasses")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub forced_pseudo_classes: Vec<String>,
}
impl<'de> serde::Deserialize<'de> for ForcePseudoStateParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ForcePseudoStateParams;
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 = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
#[serde(rename = "forcedPseudoClasses")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub forced_pseudo_classes: Vec<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ForcePseudoStateParams {
node_id: fields.node_id,
forced_pseudo_classes: fields.forced_pseudo_classes,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ForcePseudoState;
#[derive(Debug, Clone, serde::Serialize)]
pub struct ForcePseudoStateResponse {}
impl<'de> serde::Deserialize<'de> for ForcePseudoStateResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ForcePseudoStateResponse;
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(ForcePseudoStateResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for ForcePseudoState {
type Params = ForcePseudoStateParams;
type Response = ForcePseudoStateResponse;
const METHOD: &'static str = "CSS.forcePseudoState";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ForceStartingStyleParams {
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
#[serde(rename = "forced")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub forced: bool,
}
impl<'de> serde::Deserialize<'de> for ForceStartingStyleParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ForceStartingStyleParams;
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 = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
#[serde(rename = "forced")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub forced: bool,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ForceStartingStyleParams {
node_id: fields.node_id,
forced: fields.forced,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ForceStartingStyle;
#[derive(Debug, Clone, serde::Serialize)]
pub struct ForceStartingStyleResponse {}
impl<'de> serde::Deserialize<'de> for ForceStartingStyleResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ForceStartingStyleResponse;
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(ForceStartingStyleResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for ForceStartingStyle {
type Params = ForceStartingStyleParams;
type Response = ForceStartingStyleResponse;
const METHOD: &'static str = "CSS.forceStartingStyle";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetAnimatedStylesForNodeParams {
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
}
impl<'de> serde::Deserialize<'de> for GetAnimatedStylesForNodeParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetAnimatedStylesForNodeParams;
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 = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetAnimatedStylesForNodeParams {
node_id: fields.node_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetAnimatedStylesForNode;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetAnimatedStylesForNodeResponse {
#[serde(rename = "animationStyles")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub animation_styles: Option<Vec<crate::css::types::CssAnimationStyle>>,
#[serde(rename = "transitionsStyle")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub transitions_style: Option<crate::css::types::CssStyle>,
#[serde(rename = "inherited")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub inherited: Option<Vec<crate::css::types::InheritedAnimatedStyleEntry>>,
}
impl<'de> serde::Deserialize<'de> for GetAnimatedStylesForNodeResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetAnimatedStylesForNodeResponse;
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 = "animationStyles")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub animation_styles: Option<Vec<crate::css::types::CssAnimationStyle>>,
#[serde(rename = "transitionsStyle")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub transitions_style: Option<crate::css::types::CssStyle>,
#[serde(rename = "inherited")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub inherited: Option<Vec<crate::css::types::InheritedAnimatedStyleEntry>>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetAnimatedStylesForNodeResponse {
animation_styles: fields.animation_styles,
transitions_style: fields.transitions_style,
inherited: fields.inherited,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetAnimatedStylesForNode {
type Params = GetAnimatedStylesForNodeParams;
type Response = GetAnimatedStylesForNodeResponse;
const METHOD: &'static str = "CSS.getAnimatedStylesForNode";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetBackgroundColorsParams {
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
}
impl<'de> serde::Deserialize<'de> for GetBackgroundColorsParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetBackgroundColorsParams;
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 = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetBackgroundColorsParams {
node_id: fields.node_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetBackgroundColors;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetBackgroundColorsResponse {
#[serde(rename = "backgroundColors")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub background_colors: Option<Vec<String>>,
#[serde(rename = "computedFontSize")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub computed_font_size: Option<String>,
#[serde(rename = "computedFontWeight")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub computed_font_weight: Option<String>,
}
impl<'de> serde::Deserialize<'de> for GetBackgroundColorsResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetBackgroundColorsResponse;
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 = "backgroundColors")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub background_colors: Option<Vec<String>>,
#[serde(rename = "computedFontSize")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub computed_font_size: Option<String>,
#[serde(rename = "computedFontWeight")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub computed_font_weight: Option<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetBackgroundColorsResponse {
background_colors: fields.background_colors,
computed_font_size: fields.computed_font_size,
computed_font_weight: fields.computed_font_weight,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetBackgroundColors {
type Params = GetBackgroundColorsParams;
type Response = GetBackgroundColorsResponse;
const METHOD: &'static str = "CSS.getBackgroundColors";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetComputedStyleForNodeParams {
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
}
impl<'de> serde::Deserialize<'de> for GetComputedStyleForNodeParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetComputedStyleForNodeParams;
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 = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetComputedStyleForNodeParams {
node_id: fields.node_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetComputedStyleForNode;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetComputedStyleForNodeResponse {
#[serde(rename = "computedStyle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub computed_style: Vec<crate::css::types::CssComputedStyleProperty>,
#[serde(rename = "extraFields")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub extra_fields: crate::css::types::ComputedStyleExtraFields,
}
impl<'de> serde::Deserialize<'de> for GetComputedStyleForNodeResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetComputedStyleForNodeResponse;
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 = "computedStyle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub computed_style: Vec<crate::css::types::CssComputedStyleProperty>,
#[serde(rename = "extraFields")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub extra_fields: crate::css::types::ComputedStyleExtraFields,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetComputedStyleForNodeResponse {
computed_style: fields.computed_style,
extra_fields: fields.extra_fields,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetComputedStyleForNode {
type Params = GetComputedStyleForNodeParams;
type Response = GetComputedStyleForNodeResponse;
const METHOD: &'static str = "CSS.getComputedStyleForNode";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct GetEnvironmentVariablesParams {}
impl<'de> serde::Deserialize<'de> for GetEnvironmentVariablesParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetEnvironmentVariablesParams;
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(GetEnvironmentVariablesParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetEnvironmentVariables;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetEnvironmentVariablesResponse {
#[serde(rename = "environmentVariables")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub environment_variables: std::collections::BTreeMap<String, serde_json::Value>,
}
impl<'de> serde::Deserialize<'de> for GetEnvironmentVariablesResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetEnvironmentVariablesResponse;
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 = "environmentVariables")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub environment_variables:
std::collections::BTreeMap<String, serde_json::Value>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetEnvironmentVariablesResponse {
environment_variables: fields.environment_variables,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetEnvironmentVariables {
type Params = GetEnvironmentVariablesParams;
type Response = GetEnvironmentVariablesResponse;
const METHOD: &'static str = "CSS.getEnvironmentVariables";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetInlineStylesForNodeParams {
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
}
impl<'de> serde::Deserialize<'de> for GetInlineStylesForNodeParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetInlineStylesForNodeParams;
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 = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetInlineStylesForNodeParams {
node_id: fields.node_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetInlineStylesForNode;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetInlineStylesForNodeResponse {
#[serde(rename = "inlineStyle")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub inline_style: Option<crate::css::types::CssStyle>,
#[serde(rename = "attributesStyle")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub attributes_style: Option<crate::css::types::CssStyle>,
}
impl<'de> serde::Deserialize<'de> for GetInlineStylesForNodeResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetInlineStylesForNodeResponse;
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 = "inlineStyle")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub inline_style: Option<crate::css::types::CssStyle>,
#[serde(rename = "attributesStyle")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub attributes_style: Option<crate::css::types::CssStyle>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetInlineStylesForNodeResponse {
inline_style: fields.inline_style,
attributes_style: fields.attributes_style,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetInlineStylesForNode {
type Params = GetInlineStylesForNodeParams;
type Response = GetInlineStylesForNodeResponse;
const METHOD: &'static str = "CSS.getInlineStylesForNode";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetLayersForNodeParams {
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
}
impl<'de> serde::Deserialize<'de> for GetLayersForNodeParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetLayersForNodeParams;
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 = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetLayersForNodeParams {
node_id: fields.node_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetLayersForNode;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetLayersForNodeResponse {
#[serde(rename = "rootLayer")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub root_layer: crate::css::types::CssLayerData,
}
impl<'de> serde::Deserialize<'de> for GetLayersForNodeResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetLayersForNodeResponse;
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 = "rootLayer")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub root_layer: crate::css::types::CssLayerData,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetLayersForNodeResponse {
root_layer: fields.root_layer,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetLayersForNode {
type Params = GetLayersForNodeParams;
type Response = GetLayersForNodeResponse;
const METHOD: &'static str = "CSS.getLayersForNode";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetLocationForSelectorParams {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "selectorText")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub selector_text: String,
}
impl<'de> serde::Deserialize<'de> for GetLocationForSelectorParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetLocationForSelectorParams;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "selectorText")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub selector_text: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetLocationForSelectorParams {
style_sheet_id: fields.style_sheet_id,
selector_text: fields.selector_text,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetLocationForSelector;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetLocationForSelectorResponse {
#[serde(rename = "ranges")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub ranges: Vec<crate::css::types::SourceRange>,
}
impl<'de> serde::Deserialize<'de> for GetLocationForSelectorResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetLocationForSelectorResponse;
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 = "ranges")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub ranges: Vec<crate::css::types::SourceRange>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetLocationForSelectorResponse {
ranges: fields.ranges,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetLocationForSelector {
type Params = GetLocationForSelectorParams;
type Response = GetLocationForSelectorResponse;
const METHOD: &'static str = "CSS.getLocationForSelector";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetLonghandPropertiesParams {
#[serde(rename = "shorthandName")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub shorthand_name: String,
#[serde(rename = "value")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub value: String,
}
impl<'de> serde::Deserialize<'de> for GetLonghandPropertiesParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetLonghandPropertiesParams;
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 = "shorthandName")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub shorthand_name: String,
#[serde(rename = "value")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub value: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetLonghandPropertiesParams {
shorthand_name: fields.shorthand_name,
value: fields.value,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetLonghandProperties;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetLonghandPropertiesResponse {
#[serde(rename = "longhandProperties")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub longhand_properties: Vec<crate::css::types::CssProperty>,
}
impl<'de> serde::Deserialize<'de> for GetLonghandPropertiesResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetLonghandPropertiesResponse;
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 = "longhandProperties")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub longhand_properties: Vec<crate::css::types::CssProperty>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetLonghandPropertiesResponse {
longhand_properties: fields.longhand_properties,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetLonghandProperties {
type Params = GetLonghandPropertiesParams;
type Response = GetLonghandPropertiesResponse;
const METHOD: &'static str = "CSS.getLonghandProperties";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetMatchedStylesForNodeParams {
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
}
impl<'de> serde::Deserialize<'de> for GetMatchedStylesForNodeParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetMatchedStylesForNodeParams;
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 = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetMatchedStylesForNodeParams {
node_id: fields.node_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetMatchedStylesForNode;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetMatchedStylesForNodeResponse {
#[serde(rename = "inlineStyle")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub inline_style: Option<crate::css::types::CssStyle>,
#[serde(rename = "attributesStyle")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub attributes_style: Option<crate::css::types::CssStyle>,
#[serde(rename = "matchedCSSRules")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub matched_css_rules: Option<Vec<crate::css::types::RuleMatch>>,
#[serde(rename = "pseudoElements")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub pseudo_elements: Option<Vec<crate::css::types::PseudoElementMatches>>,
#[serde(rename = "inherited")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub inherited: Option<Vec<crate::css::types::InheritedStyleEntry>>,
#[serde(rename = "inheritedPseudoElements")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub inherited_pseudo_elements: Option<Vec<crate::css::types::InheritedPseudoElementMatches>>,
#[serde(rename = "cssKeyframesRules")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub css_keyframes_rules: Option<Vec<crate::css::types::CssKeyframesRule>>,
#[serde(rename = "cssPositionTryRules")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub css_position_try_rules: Option<Vec<crate::css::types::CssPositionTryRule>>,
#[serde(rename = "activePositionFallbackIndex")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub active_position_fallback_index: Option<i64>,
#[serde(rename = "cssPropertyRules")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub css_property_rules: Option<Vec<crate::css::types::CssPropertyRule>>,
#[serde(rename = "cssPropertyRegistrations")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub css_property_registrations: Option<Vec<crate::css::types::CssPropertyRegistration>>,
#[serde(rename = "cssAtRules")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub css_at_rules: Option<Vec<crate::css::types::CssAtRule>>,
#[serde(rename = "parentLayoutNodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub parent_layout_node_id: Option<crate::dom::types::NodeId>,
#[serde(rename = "cssFunctionRules")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub css_function_rules: Option<Vec<crate::css::types::CssFunctionRule>>,
}
impl<'de> serde::Deserialize<'de> for GetMatchedStylesForNodeResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetMatchedStylesForNodeResponse;
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 = "inlineStyle")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub inline_style: Option<crate::css::types::CssStyle>,
#[serde(rename = "attributesStyle")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub attributes_style: Option<crate::css::types::CssStyle>,
#[serde(rename = "matchedCSSRules")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub matched_css_rules: Option<Vec<crate::css::types::RuleMatch>>,
#[serde(rename = "pseudoElements")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub pseudo_elements: Option<Vec<crate::css::types::PseudoElementMatches>>,
#[serde(rename = "inherited")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub inherited: Option<Vec<crate::css::types::InheritedStyleEntry>>,
#[serde(rename = "inheritedPseudoElements")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub inherited_pseudo_elements:
Option<Vec<crate::css::types::InheritedPseudoElementMatches>>,
#[serde(rename = "cssKeyframesRules")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub css_keyframes_rules: Option<Vec<crate::css::types::CssKeyframesRule>>,
#[serde(rename = "cssPositionTryRules")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub css_position_try_rules: Option<Vec<crate::css::types::CssPositionTryRule>>,
#[serde(rename = "activePositionFallbackIndex")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub active_position_fallback_index: Option<i64>,
#[serde(rename = "cssPropertyRules")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub css_property_rules: Option<Vec<crate::css::types::CssPropertyRule>>,
#[serde(rename = "cssPropertyRegistrations")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub css_property_registrations:
Option<Vec<crate::css::types::CssPropertyRegistration>>,
#[serde(rename = "cssAtRules")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub css_at_rules: Option<Vec<crate::css::types::CssAtRule>>,
#[serde(rename = "parentLayoutNodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub parent_layout_node_id: Option<crate::dom::types::NodeId>,
#[serde(rename = "cssFunctionRules")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub css_function_rules: Option<Vec<crate::css::types::CssFunctionRule>>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetMatchedStylesForNodeResponse {
inline_style: fields.inline_style,
attributes_style: fields.attributes_style,
matched_css_rules: fields.matched_css_rules,
pseudo_elements: fields.pseudo_elements,
inherited: fields.inherited,
inherited_pseudo_elements: fields.inherited_pseudo_elements,
css_keyframes_rules: fields.css_keyframes_rules,
css_position_try_rules: fields.css_position_try_rules,
active_position_fallback_index: fields.active_position_fallback_index,
css_property_rules: fields.css_property_rules,
css_property_registrations: fields.css_property_registrations,
css_at_rules: fields.css_at_rules,
parent_layout_node_id: fields.parent_layout_node_id,
css_function_rules: fields.css_function_rules,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetMatchedStylesForNode {
type Params = GetMatchedStylesForNodeParams;
type Response = GetMatchedStylesForNodeResponse;
const METHOD: &'static str = "CSS.getMatchedStylesForNode";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct GetMediaQueriesParams {}
impl<'de> serde::Deserialize<'de> for GetMediaQueriesParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetMediaQueriesParams;
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(GetMediaQueriesParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetMediaQueries;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetMediaQueriesResponse {
#[serde(rename = "medias")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub medias: Vec<crate::css::types::CssMedia>,
}
impl<'de> serde::Deserialize<'de> for GetMediaQueriesResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetMediaQueriesResponse;
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 = "medias")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub medias: Vec<crate::css::types::CssMedia>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetMediaQueriesResponse {
medias: fields.medias,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetMediaQueries {
type Params = GetMediaQueriesParams;
type Response = GetMediaQueriesResponse;
const METHOD: &'static str = "CSS.getMediaQueries";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetPlatformFontsForNodeParams {
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
}
impl<'de> serde::Deserialize<'de> for GetPlatformFontsForNodeParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetPlatformFontsForNodeParams;
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 = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetPlatformFontsForNodeParams {
node_id: fields.node_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetPlatformFontsForNode;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetPlatformFontsForNodeResponse {
#[serde(rename = "fonts")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub fonts: Vec<crate::css::types::PlatformFontUsage>,
}
impl<'de> serde::Deserialize<'de> for GetPlatformFontsForNodeResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetPlatformFontsForNodeResponse;
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 = "fonts")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub fonts: Vec<crate::css::types::PlatformFontUsage>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetPlatformFontsForNodeResponse {
fonts: fields.fonts,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetPlatformFontsForNode {
type Params = GetPlatformFontsForNodeParams;
type Response = GetPlatformFontsForNodeResponse;
const METHOD: &'static str = "CSS.getPlatformFontsForNode";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetStyleSheetTextParams {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
}
impl<'de> serde::Deserialize<'de> for GetStyleSheetTextParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetStyleSheetTextParams;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetStyleSheetTextParams {
style_sheet_id: fields.style_sheet_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetStyleSheetText;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetStyleSheetTextResponse {
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
impl<'de> serde::Deserialize<'de> for GetStyleSheetTextResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetStyleSheetTextResponse;
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 = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetStyleSheetTextResponse { text: fields.text })
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetStyleSheetText {
type Params = GetStyleSheetTextParams;
type Response = GetStyleSheetTextResponse;
const METHOD: &'static str = "CSS.getStyleSheetText";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ResolveValuesParams {
#[serde(rename = "values")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub values: Vec<String>,
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
#[serde(rename = "propertyName")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub property_name: Option<String>,
#[serde(rename = "pseudoType")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub pseudo_type: Option<crate::dom::types::PseudoType>,
#[serde(rename = "pseudoIdentifier")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub pseudo_identifier: Option<String>,
}
impl<'de> serde::Deserialize<'de> for ResolveValuesParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ResolveValuesParams;
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 = "values")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub values: Vec<String>,
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
#[serde(rename = "propertyName")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub property_name: Option<String>,
#[serde(rename = "pseudoType")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub pseudo_type: Option<crate::dom::types::PseudoType>,
#[serde(rename = "pseudoIdentifier")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub pseudo_identifier: Option<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ResolveValuesParams {
values: fields.values,
node_id: fields.node_id,
property_name: fields.property_name,
pseudo_type: fields.pseudo_type,
pseudo_identifier: fields.pseudo_identifier,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ResolveValues;
#[derive(Debug, Clone, serde::Serialize)]
pub struct ResolveValuesResponse {
#[serde(rename = "results")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub results: Vec<String>,
}
impl<'de> serde::Deserialize<'de> for ResolveValuesResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ResolveValuesResponse;
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 = "results")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub results: Vec<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ResolveValuesResponse {
results: fields.results,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for ResolveValues {
type Params = ResolveValuesParams;
type Response = ResolveValuesResponse;
const METHOD: &'static str = "CSS.resolveValues";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetContainerQueryConditionTextParams {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
impl<'de> serde::Deserialize<'de> for SetContainerQueryConditionTextParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetContainerQueryConditionTextParams;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetContainerQueryConditionTextParams {
style_sheet_id: fields.style_sheet_id,
range: fields.range,
text: fields.text,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetContainerQueryConditionText;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetContainerQueryConditionTextResponse {
#[serde(rename = "containerQuery")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub container_query: crate::css::types::CssContainerQuery,
}
impl<'de> serde::Deserialize<'de> for SetContainerQueryConditionTextResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetContainerQueryConditionTextResponse;
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 = "containerQuery")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub container_query: crate::css::types::CssContainerQuery,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetContainerQueryConditionTextResponse {
container_query: fields.container_query,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetContainerQueryConditionText {
type Params = SetContainerQueryConditionTextParams;
type Response = SetContainerQueryConditionTextResponse;
const METHOD: &'static str = "CSS.setContainerQueryConditionText";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetContainerQueryTextParams {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
impl<'de> serde::Deserialize<'de> for SetContainerQueryTextParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetContainerQueryTextParams;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetContainerQueryTextParams {
style_sheet_id: fields.style_sheet_id,
range: fields.range,
text: fields.text,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetContainerQueryText;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetContainerQueryTextResponse {
#[serde(rename = "containerQuery")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub container_query: crate::css::types::CssContainerQuery,
}
impl<'de> serde::Deserialize<'de> for SetContainerQueryTextResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetContainerQueryTextResponse;
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 = "containerQuery")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub container_query: crate::css::types::CssContainerQuery,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetContainerQueryTextResponse {
container_query: fields.container_query,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetContainerQueryText {
type Params = SetContainerQueryTextParams;
type Response = SetContainerQueryTextResponse;
const METHOD: &'static str = "CSS.setContainerQueryText";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetEffectivePropertyValueForNodeParams {
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
#[serde(rename = "propertyName")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub property_name: String,
#[serde(rename = "value")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub value: String,
}
impl<'de> serde::Deserialize<'de> for SetEffectivePropertyValueForNodeParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetEffectivePropertyValueForNodeParams;
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 = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::NodeId,
#[serde(rename = "propertyName")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub property_name: String,
#[serde(rename = "value")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub value: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetEffectivePropertyValueForNodeParams {
node_id: fields.node_id,
property_name: fields.property_name,
value: fields.value,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetEffectivePropertyValueForNode;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetEffectivePropertyValueForNodeResponse {}
impl<'de> serde::Deserialize<'de> for SetEffectivePropertyValueForNodeResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetEffectivePropertyValueForNodeResponse;
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(SetEffectivePropertyValueForNodeResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetEffectivePropertyValueForNode {
type Params = SetEffectivePropertyValueForNodeParams;
type Response = SetEffectivePropertyValueForNodeResponse;
const METHOD: &'static str = "CSS.setEffectivePropertyValueForNode";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetKeyframeKeyParams {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "keyText")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub key_text: String,
}
impl<'de> serde::Deserialize<'de> for SetKeyframeKeyParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetKeyframeKeyParams;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "keyText")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub key_text: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetKeyframeKeyParams {
style_sheet_id: fields.style_sheet_id,
range: fields.range,
key_text: fields.key_text,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetKeyframeKey;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetKeyframeKeyResponse {
#[serde(rename = "keyText")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub key_text: crate::css::types::Value,
}
impl<'de> serde::Deserialize<'de> for SetKeyframeKeyResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetKeyframeKeyResponse;
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 = "keyText")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub key_text: crate::css::types::Value,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetKeyframeKeyResponse {
key_text: fields.key_text,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetKeyframeKey {
type Params = SetKeyframeKeyParams;
type Response = SetKeyframeKeyResponse;
const METHOD: &'static str = "CSS.setKeyframeKey";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetLocalFontsEnabledParams {
#[serde(rename = "enabled")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub enabled: bool,
}
impl<'de> serde::Deserialize<'de> for SetLocalFontsEnabledParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetLocalFontsEnabledParams;
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 = "enabled")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub enabled: bool,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetLocalFontsEnabledParams {
enabled: fields.enabled,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetLocalFontsEnabled;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetLocalFontsEnabledResponse {}
impl<'de> serde::Deserialize<'de> for SetLocalFontsEnabledResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetLocalFontsEnabledResponse;
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(SetLocalFontsEnabledResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetLocalFontsEnabled {
type Params = SetLocalFontsEnabledParams;
type Response = SetLocalFontsEnabledResponse;
const METHOD: &'static str = "CSS.setLocalFontsEnabled";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetMediaTextParams {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
impl<'de> serde::Deserialize<'de> for SetMediaTextParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetMediaTextParams;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetMediaTextParams {
style_sheet_id: fields.style_sheet_id,
range: fields.range,
text: fields.text,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetMediaText;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetMediaTextResponse {
#[serde(rename = "media")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub media: crate::css::types::CssMedia,
}
impl<'de> serde::Deserialize<'de> for SetMediaTextResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetMediaTextResponse;
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 = "media")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub media: crate::css::types::CssMedia,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetMediaTextResponse {
media: fields.media,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetMediaText {
type Params = SetMediaTextParams;
type Response = SetMediaTextResponse;
const METHOD: &'static str = "CSS.setMediaText";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetNavigationTextParams {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
impl<'de> serde::Deserialize<'de> for SetNavigationTextParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetNavigationTextParams;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetNavigationTextParams {
style_sheet_id: fields.style_sheet_id,
range: fields.range,
text: fields.text,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetNavigationText;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetNavigationTextResponse {
#[serde(rename = "navigation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub navigation: crate::css::types::CssNavigation,
}
impl<'de> serde::Deserialize<'de> for SetNavigationTextResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetNavigationTextResponse;
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 = "navigation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub navigation: crate::css::types::CssNavigation,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetNavigationTextResponse {
navigation: fields.navigation,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetNavigationText {
type Params = SetNavigationTextParams;
type Response = SetNavigationTextResponse;
const METHOD: &'static str = "CSS.setNavigationText";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetPropertyRulePropertyNameParams {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "propertyName")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub property_name: String,
}
impl<'de> serde::Deserialize<'de> for SetPropertyRulePropertyNameParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetPropertyRulePropertyNameParams;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "propertyName")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub property_name: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetPropertyRulePropertyNameParams {
style_sheet_id: fields.style_sheet_id,
range: fields.range,
property_name: fields.property_name,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetPropertyRulePropertyName;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetPropertyRulePropertyNameResponse {
#[serde(rename = "propertyName")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub property_name: crate::css::types::Value,
}
impl<'de> serde::Deserialize<'de> for SetPropertyRulePropertyNameResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetPropertyRulePropertyNameResponse;
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 = "propertyName")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub property_name: crate::css::types::Value,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetPropertyRulePropertyNameResponse {
property_name: fields.property_name,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetPropertyRulePropertyName {
type Params = SetPropertyRulePropertyNameParams;
type Response = SetPropertyRulePropertyNameResponse;
const METHOD: &'static str = "CSS.setPropertyRulePropertyName";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetRuleSelectorParams {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "selector")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub selector: String,
}
impl<'de> serde::Deserialize<'de> for SetRuleSelectorParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetRuleSelectorParams;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "selector")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub selector: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetRuleSelectorParams {
style_sheet_id: fields.style_sheet_id,
range: fields.range,
selector: fields.selector,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetRuleSelector;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetRuleSelectorResponse {
#[serde(rename = "selectorList")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub selector_list: crate::css::types::SelectorList,
}
impl<'de> serde::Deserialize<'de> for SetRuleSelectorResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetRuleSelectorResponse;
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 = "selectorList")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub selector_list: crate::css::types::SelectorList,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetRuleSelectorResponse {
selector_list: fields.selector_list,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetRuleSelector {
type Params = SetRuleSelectorParams;
type Response = SetRuleSelectorResponse;
const METHOD: &'static str = "CSS.setRuleSelector";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetScopeTextParams {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
impl<'de> serde::Deserialize<'de> for SetScopeTextParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetScopeTextParams;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetScopeTextParams {
style_sheet_id: fields.style_sheet_id,
range: fields.range,
text: fields.text,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetScopeText;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetScopeTextResponse {
#[serde(rename = "scope")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub scope: crate::css::types::CssScope,
}
impl<'de> serde::Deserialize<'de> for SetScopeTextResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetScopeTextResponse;
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 = "scope")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub scope: crate::css::types::CssScope,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetScopeTextResponse {
scope: fields.scope,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetScopeText {
type Params = SetScopeTextParams;
type Response = SetScopeTextResponse;
const METHOD: &'static str = "CSS.setScopeText";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetStyleSheetTextParams {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
impl<'de> serde::Deserialize<'de> for SetStyleSheetTextParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetStyleSheetTextParams;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetStyleSheetTextParams {
style_sheet_id: fields.style_sheet_id,
text: fields.text,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetStyleSheetText;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetStyleSheetTextResponse {
#[serde(rename = "sourceMapURL")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub source_map_url: Option<String>,
}
impl<'de> serde::Deserialize<'de> for SetStyleSheetTextResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetStyleSheetTextResponse;
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 = "sourceMapURL")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub source_map_url: Option<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetStyleSheetTextResponse {
source_map_url: fields.source_map_url,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetStyleSheetText {
type Params = SetStyleSheetTextParams;
type Response = SetStyleSheetTextResponse;
const METHOD: &'static str = "CSS.setStyleSheetText";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetStyleTextsParams {
#[serde(rename = "edits")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub edits: Vec<crate::css::types::StyleDeclarationEdit>,
#[serde(rename = "nodeForPropertySyntaxValidation")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub node_for_property_syntax_validation: Option<crate::dom::types::NodeId>,
}
impl<'de> serde::Deserialize<'de> for SetStyleTextsParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetStyleTextsParams;
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 = "edits")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub edits: Vec<crate::css::types::StyleDeclarationEdit>,
#[serde(rename = "nodeForPropertySyntaxValidation")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub node_for_property_syntax_validation: Option<crate::dom::types::NodeId>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetStyleTextsParams {
edits: fields.edits,
node_for_property_syntax_validation: fields.node_for_property_syntax_validation,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetStyleTexts;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetStyleTextsResponse {
#[serde(rename = "styles")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub styles: Vec<crate::css::types::CssStyle>,
}
impl<'de> serde::Deserialize<'de> for SetStyleTextsResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetStyleTextsResponse;
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 = "styles")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub styles: Vec<crate::css::types::CssStyle>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetStyleTextsResponse {
styles: fields.styles,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetStyleTexts {
type Params = SetStyleTextsParams;
type Response = SetStyleTextsResponse;
const METHOD: &'static str = "CSS.setStyleTexts";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetSupportsTextParams {
#[serde(rename = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
impl<'de> serde::Deserialize<'de> for SetSupportsTextParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetSupportsTextParams;
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 = "styleSheetId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_id: crate::dom::types::StyleSheetId,
#[serde(rename = "range")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub range: crate::css::types::SourceRange,
#[serde(rename = "text")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub text: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetSupportsTextParams {
style_sheet_id: fields.style_sheet_id,
range: fields.range,
text: fields.text,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetSupportsText;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetSupportsTextResponse {
#[serde(rename = "supports")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub supports: crate::css::types::CssSupports,
}
impl<'de> serde::Deserialize<'de> for SetSupportsTextResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetSupportsTextResponse;
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 = "supports")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub supports: crate::css::types::CssSupports,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetSupportsTextResponse {
supports: fields.supports,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetSupportsText {
type Params = SetSupportsTextParams;
type Response = SetSupportsTextResponse;
const METHOD: &'static str = "CSS.setSupportsText";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct StartRuleUsageTrackingParams {}
impl<'de> serde::Deserialize<'de> for StartRuleUsageTrackingParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = StartRuleUsageTrackingParams;
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(StartRuleUsageTrackingParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct StartRuleUsageTracking;
#[derive(Debug, Clone, serde::Serialize)]
pub struct StartRuleUsageTrackingResponse {}
impl<'de> serde::Deserialize<'de> for StartRuleUsageTrackingResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = StartRuleUsageTrackingResponse;
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(StartRuleUsageTrackingResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for StartRuleUsageTracking {
type Params = StartRuleUsageTrackingParams;
type Response = StartRuleUsageTrackingResponse;
const METHOD: &'static str = "CSS.startRuleUsageTracking";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct StopRuleUsageTrackingParams {}
impl<'de> serde::Deserialize<'de> for StopRuleUsageTrackingParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = StopRuleUsageTrackingParams;
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(StopRuleUsageTrackingParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct StopRuleUsageTracking;
#[derive(Debug, Clone, serde::Serialize)]
pub struct StopRuleUsageTrackingResponse {
#[serde(rename = "ruleUsage")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub rule_usage: Vec<crate::css::types::RuleUsage>,
}
impl<'de> serde::Deserialize<'de> for StopRuleUsageTrackingResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = StopRuleUsageTrackingResponse;
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 = "ruleUsage")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub rule_usage: Vec<crate::css::types::RuleUsage>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(StopRuleUsageTrackingResponse {
rule_usage: fields.rule_usage,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for StopRuleUsageTracking {
type Params = StopRuleUsageTrackingParams;
type Response = StopRuleUsageTrackingResponse;
const METHOD: &'static str = "CSS.stopRuleUsageTracking";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct TakeComputedStyleUpdatesParams {}
impl<'de> serde::Deserialize<'de> for TakeComputedStyleUpdatesParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = TakeComputedStyleUpdatesParams;
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(TakeComputedStyleUpdatesParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct TakeComputedStyleUpdates;
#[derive(Debug, Clone, serde::Serialize)]
pub struct TakeComputedStyleUpdatesResponse {
#[serde(rename = "nodeIds")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_ids: Vec<crate::dom::types::NodeId>,
}
impl<'de> serde::Deserialize<'de> for TakeComputedStyleUpdatesResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = TakeComputedStyleUpdatesResponse;
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 = "nodeIds")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_ids: Vec<crate::dom::types::NodeId>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(TakeComputedStyleUpdatesResponse {
node_ids: fields.node_ids,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for TakeComputedStyleUpdates {
type Params = TakeComputedStyleUpdatesParams;
type Response = TakeComputedStyleUpdatesResponse;
const METHOD: &'static str = "CSS.takeComputedStyleUpdates";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct TakeCoverageDeltaParams {}
impl<'de> serde::Deserialize<'de> for TakeCoverageDeltaParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = TakeCoverageDeltaParams;
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(TakeCoverageDeltaParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct TakeCoverageDelta;
#[derive(Debug, Clone, serde::Serialize)]
pub struct TakeCoverageDeltaResponse {
#[serde(rename = "coverage")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub coverage: Vec<crate::css::types::RuleUsage>,
#[serde(rename = "timestamp")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub timestamp: ydp_core::FiniteF64,
}
impl<'de> serde::Deserialize<'de> for TakeCoverageDeltaResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = TakeCoverageDeltaResponse;
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 = "coverage")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub coverage: Vec<crate::css::types::RuleUsage>,
#[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(TakeCoverageDeltaResponse {
coverage: fields.coverage,
timestamp: fields.timestamp,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for TakeCoverageDelta {
type Params = TakeCoverageDeltaParams;
type Response = TakeCoverageDeltaResponse;
const METHOD: &'static str = "CSS.takeCoverageDelta";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct TrackComputedStyleUpdatesParams {
#[serde(rename = "propertiesToTrack")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub properties_to_track: Vec<crate::css::types::CssComputedStyleProperty>,
}
impl<'de> serde::Deserialize<'de> for TrackComputedStyleUpdatesParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = TrackComputedStyleUpdatesParams;
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 = "propertiesToTrack")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub properties_to_track: Vec<crate::css::types::CssComputedStyleProperty>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(TrackComputedStyleUpdatesParams {
properties_to_track: fields.properties_to_track,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct TrackComputedStyleUpdates;
#[derive(Debug, Clone, serde::Serialize)]
pub struct TrackComputedStyleUpdatesResponse {}
impl<'de> serde::Deserialize<'de> for TrackComputedStyleUpdatesResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = TrackComputedStyleUpdatesResponse;
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(TrackComputedStyleUpdatesResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for TrackComputedStyleUpdates {
type Params = TrackComputedStyleUpdatesParams;
type Response = TrackComputedStyleUpdatesResponse;
const METHOD: &'static str = "CSS.trackComputedStyleUpdates";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct TrackComputedStyleUpdatesForNodeParams {
#[serde(rename = "nodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub node_id: Option<crate::dom::types::NodeId>,
}
impl<'de> serde::Deserialize<'de> for TrackComputedStyleUpdatesForNodeParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = TrackComputedStyleUpdatesForNodeParams;
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 = "nodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub node_id: Option<crate::dom::types::NodeId>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(TrackComputedStyleUpdatesForNodeParams {
node_id: fields.node_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct TrackComputedStyleUpdatesForNode;
#[derive(Debug, Clone, serde::Serialize)]
pub struct TrackComputedStyleUpdatesForNodeResponse {}
impl<'de> serde::Deserialize<'de> for TrackComputedStyleUpdatesForNodeResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = TrackComputedStyleUpdatesForNodeResponse;
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(TrackComputedStyleUpdatesForNodeResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for TrackComputedStyleUpdatesForNode {
type Params = TrackComputedStyleUpdatesForNodeParams;
type Response = TrackComputedStyleUpdatesForNodeResponse;
const METHOD: &'static str = "CSS.trackComputedStyleUpdatesForNode";
}