use serde::{Serialize, Deserialize};
use serde_json::Value as JsonValue;
use std::borrow::Cow;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum StyleSheetOrigin {
#[default]
#[serde(rename = "injected")]
Injected,
#[serde(rename = "user-agent")]
UserAgent,
#[serde(rename = "inspector")]
Inspector,
#[serde(rename = "regular")]
Regular,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct PseudoElementMatches<'a> {
pseudoType: crate::dom::PseudoType,
#[serde(skip_serializing_if = "Option::is_none")]
pseudoIdentifier: Option<Cow<'a, str>>,
matches: Vec<RuleMatch<'a>>,
}
impl<'a> PseudoElementMatches<'a> {
pub fn builder(pseudoType: crate::dom::PseudoType, matches: Vec<RuleMatch<'a>>) -> PseudoElementMatchesBuilder<'a> {
PseudoElementMatchesBuilder {
pseudoType: pseudoType,
pseudoIdentifier: None,
matches: matches,
}
}
pub fn pseudoType(&self) -> &crate::dom::PseudoType { &self.pseudoType }
pub fn pseudoIdentifier(&self) -> Option<&str> { self.pseudoIdentifier.as_deref() }
pub fn matches(&self) -> &[RuleMatch<'a>] { &self.matches }
}
pub struct PseudoElementMatchesBuilder<'a> {
pseudoType: crate::dom::PseudoType,
pseudoIdentifier: Option<Cow<'a, str>>,
matches: Vec<RuleMatch<'a>>,
}
impl<'a> PseudoElementMatchesBuilder<'a> {
pub fn pseudoIdentifier(mut self, pseudoIdentifier: impl Into<Cow<'a, str>>) -> Self { self.pseudoIdentifier = Some(pseudoIdentifier.into()); self }
pub fn build(self) -> PseudoElementMatches<'a> {
PseudoElementMatches {
pseudoType: self.pseudoType,
pseudoIdentifier: self.pseudoIdentifier,
matches: self.matches,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSAnimationStyle<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
name: Option<Cow<'a, str>>,
style: CSSStyle<'a>,
}
impl<'a> CSSAnimationStyle<'a> {
pub fn builder(style: CSSStyle<'a>) -> CSSAnimationStyleBuilder<'a> {
CSSAnimationStyleBuilder {
name: None,
style: style,
}
}
pub fn name(&self) -> Option<&str> { self.name.as_deref() }
pub fn style(&self) -> &CSSStyle<'a> { &self.style }
}
pub struct CSSAnimationStyleBuilder<'a> {
name: Option<Cow<'a, str>>,
style: CSSStyle<'a>,
}
impl<'a> CSSAnimationStyleBuilder<'a> {
pub fn name(mut self, name: impl Into<Cow<'a, str>>) -> Self { self.name = Some(name.into()); self }
pub fn build(self) -> CSSAnimationStyle<'a> {
CSSAnimationStyle {
name: self.name,
style: self.style,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct InheritedStyleEntry<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
inlineStyle: Option<CSSStyle<'a>>,
matchedCSSRules: Vec<RuleMatch<'a>>,
}
impl<'a> InheritedStyleEntry<'a> {
pub fn builder(matchedCSSRules: Vec<RuleMatch<'a>>) -> InheritedStyleEntryBuilder<'a> {
InheritedStyleEntryBuilder {
inlineStyle: None,
matchedCSSRules: matchedCSSRules,
}
}
pub fn inlineStyle(&self) -> Option<&CSSStyle<'a>> { self.inlineStyle.as_ref() }
pub fn matchedCSSRules(&self) -> &[RuleMatch<'a>] { &self.matchedCSSRules }
}
pub struct InheritedStyleEntryBuilder<'a> {
inlineStyle: Option<CSSStyle<'a>>,
matchedCSSRules: Vec<RuleMatch<'a>>,
}
impl<'a> InheritedStyleEntryBuilder<'a> {
pub fn inlineStyle(mut self, inlineStyle: CSSStyle<'a>) -> Self { self.inlineStyle = Some(inlineStyle); self }
pub fn build(self) -> InheritedStyleEntry<'a> {
InheritedStyleEntry {
inlineStyle: self.inlineStyle,
matchedCSSRules: self.matchedCSSRules,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct InheritedAnimatedStyleEntry<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
animationStyles: Option<Vec<CSSAnimationStyle<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
transitionsStyle: Option<CSSStyle<'a>>,
}
impl<'a> InheritedAnimatedStyleEntry<'a> {
pub fn builder() -> InheritedAnimatedStyleEntryBuilder<'a> {
InheritedAnimatedStyleEntryBuilder {
animationStyles: None,
transitionsStyle: None,
}
}
pub fn animationStyles(&self) -> Option<&[CSSAnimationStyle<'a>]> { self.animationStyles.as_deref() }
pub fn transitionsStyle(&self) -> Option<&CSSStyle<'a>> { self.transitionsStyle.as_ref() }
}
#[derive(Default)]
pub struct InheritedAnimatedStyleEntryBuilder<'a> {
animationStyles: Option<Vec<CSSAnimationStyle<'a>>>,
transitionsStyle: Option<CSSStyle<'a>>,
}
impl<'a> InheritedAnimatedStyleEntryBuilder<'a> {
pub fn animationStyles(mut self, animationStyles: Vec<CSSAnimationStyle<'a>>) -> Self { self.animationStyles = Some(animationStyles); self }
pub fn transitionsStyle(mut self, transitionsStyle: CSSStyle<'a>) -> Self { self.transitionsStyle = Some(transitionsStyle); self }
pub fn build(self) -> InheritedAnimatedStyleEntry<'a> {
InheritedAnimatedStyleEntry {
animationStyles: self.animationStyles,
transitionsStyle: self.transitionsStyle,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct InheritedPseudoElementMatches<'a> {
pseudoElements: Vec<PseudoElementMatches<'a>>,
}
impl<'a> InheritedPseudoElementMatches<'a> {
pub fn builder(pseudoElements: Vec<PseudoElementMatches<'a>>) -> InheritedPseudoElementMatchesBuilder<'a> {
InheritedPseudoElementMatchesBuilder {
pseudoElements: pseudoElements,
}
}
pub fn pseudoElements(&self) -> &[PseudoElementMatches<'a>] { &self.pseudoElements }
}
pub struct InheritedPseudoElementMatchesBuilder<'a> {
pseudoElements: Vec<PseudoElementMatches<'a>>,
}
impl<'a> InheritedPseudoElementMatchesBuilder<'a> {
pub fn build(self) -> InheritedPseudoElementMatches<'a> {
InheritedPseudoElementMatches {
pseudoElements: self.pseudoElements,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RuleMatch<'a> {
rule: CSSRule<'a>,
matchingSelectors: Vec<i64>,
}
impl<'a> RuleMatch<'a> {
pub fn builder(rule: CSSRule<'a>, matchingSelectors: Vec<i64>) -> RuleMatchBuilder<'a> {
RuleMatchBuilder {
rule: rule,
matchingSelectors: matchingSelectors,
}
}
pub fn rule(&self) -> &CSSRule<'a> { &self.rule }
pub fn matchingSelectors(&self) -> &[i64] { &self.matchingSelectors }
}
pub struct RuleMatchBuilder<'a> {
rule: CSSRule<'a>,
matchingSelectors: Vec<i64>,
}
impl<'a> RuleMatchBuilder<'a> {
pub fn build(self) -> RuleMatch<'a> {
RuleMatch {
rule: self.rule,
matchingSelectors: self.matchingSelectors,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ProtocolValue<'a> {
text: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
range: Option<SourceRange>,
#[serde(skip_serializing_if = "Option::is_none")]
specificity: Option<Specificity>,
}
impl<'a> ProtocolValue<'a> {
pub fn builder(text: impl Into<Cow<'a, str>>) -> ProtocolValueBuilder<'a> {
ProtocolValueBuilder {
text: text.into(),
range: None,
specificity: None,
}
}
pub fn text(&self) -> &str { self.text.as_ref() }
pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
pub fn specificity(&self) -> Option<&Specificity> { self.specificity.as_ref() }
}
pub struct ProtocolValueBuilder<'a> {
text: Cow<'a, str>,
range: Option<SourceRange>,
specificity: Option<Specificity>,
}
impl<'a> ProtocolValueBuilder<'a> {
pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
pub fn specificity(mut self, specificity: Specificity) -> Self { self.specificity = Some(specificity); self }
pub fn build(self) -> ProtocolValue<'a> {
ProtocolValue {
text: self.text,
range: self.range,
specificity: self.specificity,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct Specificity {
a: i64,
b: i64,
c: i64,
}
impl Specificity {
pub fn builder(a: i64, b: i64, c: i64) -> SpecificityBuilder {
SpecificityBuilder {
a: a,
b: b,
c: c,
}
}
pub fn a(&self) -> i64 { self.a }
pub fn b(&self) -> i64 { self.b }
pub fn c(&self) -> i64 { self.c }
}
pub struct SpecificityBuilder {
a: i64,
b: i64,
c: i64,
}
impl SpecificityBuilder {
pub fn build(self) -> Specificity {
Specificity {
a: self.a,
b: self.b,
c: self.c,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SelectorList<'a> {
selectors: Vec<ProtocolValue<'a>>,
text: Cow<'a, str>,
}
impl<'a> SelectorList<'a> {
pub fn builder(selectors: Vec<ProtocolValue<'a>>, text: impl Into<Cow<'a, str>>) -> SelectorListBuilder<'a> {
SelectorListBuilder {
selectors: selectors,
text: text.into(),
}
}
pub fn selectors(&self) -> &[ProtocolValue<'a>] { &self.selectors }
pub fn text(&self) -> &str { self.text.as_ref() }
}
pub struct SelectorListBuilder<'a> {
selectors: Vec<ProtocolValue<'a>>,
text: Cow<'a, str>,
}
impl<'a> SelectorListBuilder<'a> {
pub fn build(self) -> SelectorList<'a> {
SelectorList {
selectors: self.selectors,
text: self.text,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSStyleSheetHeader<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
frameId: crate::page::FrameId<'a>,
sourceURL: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
sourceMapURL: Option<Cow<'a, str>>,
origin: StyleSheetOrigin,
title: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
ownerNode: Option<crate::dom::BackendNodeId>,
disabled: bool,
#[serde(skip_serializing_if = "Option::is_none")]
hasSourceURL: Option<bool>,
isInline: bool,
isMutable: bool,
isConstructed: bool,
startLine: f64,
startColumn: f64,
length: f64,
endLine: f64,
endColumn: f64,
#[serde(skip_serializing_if = "Option::is_none")]
loadingFailed: Option<bool>,
}
impl<'a> CSSStyleSheetHeader<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>, frameId: crate::page::FrameId<'a>, sourceURL: impl Into<Cow<'a, str>>, origin: StyleSheetOrigin, title: impl Into<Cow<'a, str>>, disabled: bool, isInline: bool, isMutable: bool, isConstructed: bool, startLine: f64, startColumn: f64, length: f64, endLine: f64, endColumn: f64) -> CSSStyleSheetHeaderBuilder<'a> {
CSSStyleSheetHeaderBuilder {
styleSheetId: styleSheetId,
frameId: frameId,
sourceURL: sourceURL.into(),
sourceMapURL: None,
origin: origin,
title: title.into(),
ownerNode: None,
disabled: disabled,
hasSourceURL: None,
isInline: isInline,
isMutable: isMutable,
isConstructed: isConstructed,
startLine: startLine,
startColumn: startColumn,
length: length,
endLine: endLine,
endColumn: endColumn,
loadingFailed: None,
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
pub fn frameId(&self) -> &crate::page::FrameId<'a> { &self.frameId }
pub fn sourceURL(&self) -> &str { self.sourceURL.as_ref() }
pub fn sourceMapURL(&self) -> Option<&str> { self.sourceMapURL.as_deref() }
pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
pub fn title(&self) -> &str { self.title.as_ref() }
pub fn ownerNode(&self) -> Option<&crate::dom::BackendNodeId> { self.ownerNode.as_ref() }
pub fn disabled(&self) -> bool { self.disabled }
pub fn hasSourceURL(&self) -> Option<bool> { self.hasSourceURL }
pub fn isInline(&self) -> bool { self.isInline }
pub fn isMutable(&self) -> bool { self.isMutable }
pub fn isConstructed(&self) -> bool { self.isConstructed }
pub fn startLine(&self) -> f64 { self.startLine }
pub fn startColumn(&self) -> f64 { self.startColumn }
pub fn length(&self) -> f64 { self.length }
pub fn endLine(&self) -> f64 { self.endLine }
pub fn endColumn(&self) -> f64 { self.endColumn }
pub fn loadingFailed(&self) -> Option<bool> { self.loadingFailed }
}
pub struct CSSStyleSheetHeaderBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
frameId: crate::page::FrameId<'a>,
sourceURL: Cow<'a, str>,
sourceMapURL: Option<Cow<'a, str>>,
origin: StyleSheetOrigin,
title: Cow<'a, str>,
ownerNode: Option<crate::dom::BackendNodeId>,
disabled: bool,
hasSourceURL: Option<bool>,
isInline: bool,
isMutable: bool,
isConstructed: bool,
startLine: f64,
startColumn: f64,
length: f64,
endLine: f64,
endColumn: f64,
loadingFailed: Option<bool>,
}
impl<'a> CSSStyleSheetHeaderBuilder<'a> {
pub fn sourceMapURL(mut self, sourceMapURL: impl Into<Cow<'a, str>>) -> Self { self.sourceMapURL = Some(sourceMapURL.into()); self }
pub fn ownerNode(mut self, ownerNode: crate::dom::BackendNodeId) -> Self { self.ownerNode = Some(ownerNode); self }
pub fn hasSourceURL(mut self, hasSourceURL: bool) -> Self { self.hasSourceURL = Some(hasSourceURL); self }
pub fn loadingFailed(mut self, loadingFailed: bool) -> Self { self.loadingFailed = Some(loadingFailed); self }
pub fn build(self) -> CSSStyleSheetHeader<'a> {
CSSStyleSheetHeader {
styleSheetId: self.styleSheetId,
frameId: self.frameId,
sourceURL: self.sourceURL,
sourceMapURL: self.sourceMapURL,
origin: self.origin,
title: self.title,
ownerNode: self.ownerNode,
disabled: self.disabled,
hasSourceURL: self.hasSourceURL,
isInline: self.isInline,
isMutable: self.isMutable,
isConstructed: self.isConstructed,
startLine: self.startLine,
startColumn: self.startColumn,
length: self.length,
endLine: self.endLine,
endColumn: self.endColumn,
loadingFailed: self.loadingFailed,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSRule<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
selectorList: SelectorList<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
nestingSelectors: Option<Vec<Cow<'a, str>>>,
origin: StyleSheetOrigin,
style: CSSStyle<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
originTreeScopeNodeId: Option<crate::dom::BackendNodeId>,
#[serde(skip_serializing_if = "Option::is_none")]
media: Option<Vec<CSSMedia<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
containerQueries: Option<Vec<CSSContainerQuery<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
supports: Option<Vec<CSSSupports<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
layers: Option<Vec<CSSLayer<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
scopes: Option<Vec<CSSScope<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
ruleTypes: Option<Vec<CSSRuleType>>,
#[serde(skip_serializing_if = "Option::is_none")]
startingStyles: Option<Vec<CSSStartingStyle<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
navigations: Option<Vec<CSSNavigation<'a>>>,
}
impl<'a> CSSRule<'a> {
pub fn builder(selectorList: SelectorList<'a>, origin: StyleSheetOrigin, style: CSSStyle<'a>) -> CSSRuleBuilder<'a> {
CSSRuleBuilder {
styleSheetId: None,
selectorList: selectorList,
nestingSelectors: None,
origin: origin,
style: style,
originTreeScopeNodeId: None,
media: None,
containerQueries: None,
supports: None,
layers: None,
scopes: None,
ruleTypes: None,
startingStyles: None,
navigations: None,
}
}
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
pub fn selectorList(&self) -> &SelectorList<'a> { &self.selectorList }
pub fn nestingSelectors(&self) -> Option<&[Cow<'a, str>]> { self.nestingSelectors.as_deref() }
pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
pub fn style(&self) -> &CSSStyle<'a> { &self.style }
pub fn originTreeScopeNodeId(&self) -> Option<&crate::dom::BackendNodeId> { self.originTreeScopeNodeId.as_ref() }
pub fn media(&self) -> Option<&[CSSMedia<'a>]> { self.media.as_deref() }
pub fn containerQueries(&self) -> Option<&[CSSContainerQuery<'a>]> { self.containerQueries.as_deref() }
pub fn supports(&self) -> Option<&[CSSSupports<'a>]> { self.supports.as_deref() }
pub fn layers(&self) -> Option<&[CSSLayer<'a>]> { self.layers.as_deref() }
pub fn scopes(&self) -> Option<&[CSSScope<'a>]> { self.scopes.as_deref() }
pub fn ruleTypes(&self) -> Option<&[CSSRuleType]> { self.ruleTypes.as_deref() }
pub fn startingStyles(&self) -> Option<&[CSSStartingStyle<'a>]> { self.startingStyles.as_deref() }
pub fn navigations(&self) -> Option<&[CSSNavigation<'a>]> { self.navigations.as_deref() }
}
pub struct CSSRuleBuilder<'a> {
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
selectorList: SelectorList<'a>,
nestingSelectors: Option<Vec<Cow<'a, str>>>,
origin: StyleSheetOrigin,
style: CSSStyle<'a>,
originTreeScopeNodeId: Option<crate::dom::BackendNodeId>,
media: Option<Vec<CSSMedia<'a>>>,
containerQueries: Option<Vec<CSSContainerQuery<'a>>>,
supports: Option<Vec<CSSSupports<'a>>>,
layers: Option<Vec<CSSLayer<'a>>>,
scopes: Option<Vec<CSSScope<'a>>>,
ruleTypes: Option<Vec<CSSRuleType>>,
startingStyles: Option<Vec<CSSStartingStyle<'a>>>,
navigations: Option<Vec<CSSNavigation<'a>>>,
}
impl<'a> CSSRuleBuilder<'a> {
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn nestingSelectors(mut self, nestingSelectors: Vec<Cow<'a, str>>) -> Self { self.nestingSelectors = Some(nestingSelectors); self }
pub fn originTreeScopeNodeId(mut self, originTreeScopeNodeId: crate::dom::BackendNodeId) -> Self { self.originTreeScopeNodeId = Some(originTreeScopeNodeId); self }
pub fn media(mut self, media: Vec<CSSMedia<'a>>) -> Self { self.media = Some(media); self }
pub fn containerQueries(mut self, containerQueries: Vec<CSSContainerQuery<'a>>) -> Self { self.containerQueries = Some(containerQueries); self }
pub fn supports(mut self, supports: Vec<CSSSupports<'a>>) -> Self { self.supports = Some(supports); self }
pub fn layers(mut self, layers: Vec<CSSLayer<'a>>) -> Self { self.layers = Some(layers); self }
pub fn scopes(mut self, scopes: Vec<CSSScope<'a>>) -> Self { self.scopes = Some(scopes); self }
pub fn ruleTypes(mut self, ruleTypes: Vec<CSSRuleType>) -> Self { self.ruleTypes = Some(ruleTypes); self }
pub fn startingStyles(mut self, startingStyles: Vec<CSSStartingStyle<'a>>) -> Self { self.startingStyles = Some(startingStyles); self }
pub fn navigations(mut self, navigations: Vec<CSSNavigation<'a>>) -> Self { self.navigations = Some(navigations); self }
pub fn build(self) -> CSSRule<'a> {
CSSRule {
styleSheetId: self.styleSheetId,
selectorList: self.selectorList,
nestingSelectors: self.nestingSelectors,
origin: self.origin,
style: self.style,
originTreeScopeNodeId: self.originTreeScopeNodeId,
media: self.media,
containerQueries: self.containerQueries,
supports: self.supports,
layers: self.layers,
scopes: self.scopes,
ruleTypes: self.ruleTypes,
startingStyles: self.startingStyles,
navigations: self.navigations,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum CSSRuleType {
#[default]
#[serde(rename = "MediaRule")]
MediaRule,
#[serde(rename = "SupportsRule")]
SupportsRule,
#[serde(rename = "ContainerRule")]
ContainerRule,
#[serde(rename = "LayerRule")]
LayerRule,
#[serde(rename = "ScopeRule")]
ScopeRule,
#[serde(rename = "StyleRule")]
StyleRule,
#[serde(rename = "StartingStyleRule")]
StartingStyleRule,
#[serde(rename = "NavigationRule")]
NavigationRule,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RuleUsage<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
startOffset: f64,
endOffset: f64,
used: bool,
}
impl<'a> RuleUsage<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>, startOffset: f64, endOffset: f64, used: bool) -> RuleUsageBuilder<'a> {
RuleUsageBuilder {
styleSheetId: styleSheetId,
startOffset: startOffset,
endOffset: endOffset,
used: used,
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
pub fn startOffset(&self) -> f64 { self.startOffset }
pub fn endOffset(&self) -> f64 { self.endOffset }
pub fn used(&self) -> bool { self.used }
}
pub struct RuleUsageBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
startOffset: f64,
endOffset: f64,
used: bool,
}
impl<'a> RuleUsageBuilder<'a> {
pub fn build(self) -> RuleUsage<'a> {
RuleUsage {
styleSheetId: self.styleSheetId,
startOffset: self.startOffset,
endOffset: self.endOffset,
used: self.used,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SourceRange {
startLine: i64,
startColumn: i64,
endLine: i64,
endColumn: i64,
}
impl SourceRange {
pub fn builder(startLine: i64, startColumn: i64, endLine: i64, endColumn: i64) -> SourceRangeBuilder {
SourceRangeBuilder {
startLine: startLine,
startColumn: startColumn,
endLine: endLine,
endColumn: endColumn,
}
}
pub fn startLine(&self) -> i64 { self.startLine }
pub fn startColumn(&self) -> i64 { self.startColumn }
pub fn endLine(&self) -> i64 { self.endLine }
pub fn endColumn(&self) -> i64 { self.endColumn }
}
pub struct SourceRangeBuilder {
startLine: i64,
startColumn: i64,
endLine: i64,
endColumn: i64,
}
impl SourceRangeBuilder {
pub fn build(self) -> SourceRange {
SourceRange {
startLine: self.startLine,
startColumn: self.startColumn,
endLine: self.endLine,
endColumn: self.endColumn,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ShorthandEntry<'a> {
name: Cow<'a, str>,
value: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
important: Option<bool>,
}
impl<'a> ShorthandEntry<'a> {
pub fn builder(name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> ShorthandEntryBuilder<'a> {
ShorthandEntryBuilder {
name: name.into(),
value: value.into(),
important: None,
}
}
pub fn name(&self) -> &str { self.name.as_ref() }
pub fn value(&self) -> &str { self.value.as_ref() }
pub fn important(&self) -> Option<bool> { self.important }
}
pub struct ShorthandEntryBuilder<'a> {
name: Cow<'a, str>,
value: Cow<'a, str>,
important: Option<bool>,
}
impl<'a> ShorthandEntryBuilder<'a> {
pub fn important(mut self, important: bool) -> Self { self.important = Some(important); self }
pub fn build(self) -> ShorthandEntry<'a> {
ShorthandEntry {
name: self.name,
value: self.value,
important: self.important,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSComputedStyleProperty<'a> {
name: Cow<'a, str>,
value: Cow<'a, str>,
}
impl<'a> CSSComputedStyleProperty<'a> {
pub fn builder(name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> CSSComputedStylePropertyBuilder<'a> {
CSSComputedStylePropertyBuilder {
name: name.into(),
value: value.into(),
}
}
pub fn name(&self) -> &str { self.name.as_ref() }
pub fn value(&self) -> &str { self.value.as_ref() }
}
pub struct CSSComputedStylePropertyBuilder<'a> {
name: Cow<'a, str>,
value: Cow<'a, str>,
}
impl<'a> CSSComputedStylePropertyBuilder<'a> {
pub fn build(self) -> CSSComputedStyleProperty<'a> {
CSSComputedStyleProperty {
name: self.name,
value: self.value,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ComputedStyleExtraFields {
isAppearanceBase: bool,
}
impl ComputedStyleExtraFields {
pub fn builder(isAppearanceBase: bool) -> ComputedStyleExtraFieldsBuilder {
ComputedStyleExtraFieldsBuilder {
isAppearanceBase: isAppearanceBase,
}
}
pub fn isAppearanceBase(&self) -> bool { self.isAppearanceBase }
}
pub struct ComputedStyleExtraFieldsBuilder {
isAppearanceBase: bool,
}
impl ComputedStyleExtraFieldsBuilder {
pub fn build(self) -> ComputedStyleExtraFields {
ComputedStyleExtraFields {
isAppearanceBase: self.isAppearanceBase,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSStyle<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
cssProperties: Vec<CSSProperty<'a>>,
shorthandEntries: Vec<ShorthandEntry<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
cssText: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none")]
range: Option<SourceRange>,
}
impl<'a> CSSStyle<'a> {
pub fn builder(cssProperties: Vec<CSSProperty<'a>>, shorthandEntries: Vec<ShorthandEntry<'a>>) -> CSSStyleBuilder<'a> {
CSSStyleBuilder {
styleSheetId: None,
cssProperties: cssProperties,
shorthandEntries: shorthandEntries,
cssText: None,
range: None,
}
}
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
pub fn cssProperties(&self) -> &[CSSProperty<'a>] { &self.cssProperties }
pub fn shorthandEntries(&self) -> &[ShorthandEntry<'a>] { &self.shorthandEntries }
pub fn cssText(&self) -> Option<&str> { self.cssText.as_deref() }
pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
}
pub struct CSSStyleBuilder<'a> {
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
cssProperties: Vec<CSSProperty<'a>>,
shorthandEntries: Vec<ShorthandEntry<'a>>,
cssText: Option<Cow<'a, str>>,
range: Option<SourceRange>,
}
impl<'a> CSSStyleBuilder<'a> {
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn cssText(mut self, cssText: impl Into<Cow<'a, str>>) -> Self { self.cssText = Some(cssText.into()); self }
pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
pub fn build(self) -> CSSStyle<'a> {
CSSStyle {
styleSheetId: self.styleSheetId,
cssProperties: self.cssProperties,
shorthandEntries: self.shorthandEntries,
cssText: self.cssText,
range: self.range,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSProperty<'a> {
name: Cow<'a, str>,
value: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
important: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
implicit: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
text: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none")]
parsedOk: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
disabled: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
range: Option<SourceRange>,
#[serde(skip_serializing_if = "Option::is_none")]
longhandProperties: Option<Vec<Box<CSSProperty<'a>>>>,
}
impl<'a> CSSProperty<'a> {
pub fn builder(name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> CSSPropertyBuilder<'a> {
CSSPropertyBuilder {
name: name.into(),
value: value.into(),
important: None,
implicit: None,
text: None,
parsedOk: None,
disabled: None,
range: None,
longhandProperties: None,
}
}
pub fn name(&self) -> &str { self.name.as_ref() }
pub fn value(&self) -> &str { self.value.as_ref() }
pub fn important(&self) -> Option<bool> { self.important }
pub fn implicit(&self) -> Option<bool> { self.implicit }
pub fn text(&self) -> Option<&str> { self.text.as_deref() }
pub fn parsedOk(&self) -> Option<bool> { self.parsedOk }
pub fn disabled(&self) -> Option<bool> { self.disabled }
pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
pub fn longhandProperties(&self) -> Option<&[Box<CSSProperty<'a>>]> { self.longhandProperties.as_deref() }
}
pub struct CSSPropertyBuilder<'a> {
name: Cow<'a, str>,
value: Cow<'a, str>,
important: Option<bool>,
implicit: Option<bool>,
text: Option<Cow<'a, str>>,
parsedOk: Option<bool>,
disabled: Option<bool>,
range: Option<SourceRange>,
longhandProperties: Option<Vec<Box<CSSProperty<'a>>>>,
}
impl<'a> CSSPropertyBuilder<'a> {
pub fn important(mut self, important: bool) -> Self { self.important = Some(important); self }
pub fn implicit(mut self, implicit: bool) -> Self { self.implicit = Some(implicit); self }
pub fn text(mut self, text: impl Into<Cow<'a, str>>) -> Self { self.text = Some(text.into()); self }
pub fn parsedOk(mut self, parsedOk: bool) -> Self { self.parsedOk = Some(parsedOk); self }
pub fn disabled(mut self, disabled: bool) -> Self { self.disabled = Some(disabled); self }
pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
pub fn longhandProperties(mut self, longhandProperties: Vec<Box<CSSProperty<'a>>>) -> Self { self.longhandProperties = Some(longhandProperties); self }
pub fn build(self) -> CSSProperty<'a> {
CSSProperty {
name: self.name,
value: self.value,
important: self.important,
implicit: self.implicit,
text: self.text,
parsedOk: self.parsedOk,
disabled: self.disabled,
range: self.range,
longhandProperties: self.longhandProperties,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSMedia<'a> {
text: Cow<'a, str>,
source: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
sourceURL: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none")]
range: Option<SourceRange>,
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
mediaList: Option<Vec<MediaQuery<'a>>>,
}
impl<'a> CSSMedia<'a> {
pub fn builder(text: impl Into<Cow<'a, str>>, source: impl Into<Cow<'a, str>>) -> CSSMediaBuilder<'a> {
CSSMediaBuilder {
text: text.into(),
source: source.into(),
sourceURL: None,
range: None,
styleSheetId: None,
mediaList: None,
}
}
pub fn text(&self) -> &str { self.text.as_ref() }
pub fn source(&self) -> &str { self.source.as_ref() }
pub fn sourceURL(&self) -> Option<&str> { self.sourceURL.as_deref() }
pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
pub fn mediaList(&self) -> Option<&[MediaQuery<'a>]> { self.mediaList.as_deref() }
}
pub struct CSSMediaBuilder<'a> {
text: Cow<'a, str>,
source: Cow<'a, str>,
sourceURL: Option<Cow<'a, str>>,
range: Option<SourceRange>,
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
mediaList: Option<Vec<MediaQuery<'a>>>,
}
impl<'a> CSSMediaBuilder<'a> {
pub fn sourceURL(mut self, sourceURL: impl Into<Cow<'a, str>>) -> Self { self.sourceURL = Some(sourceURL.into()); self }
pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn mediaList(mut self, mediaList: Vec<MediaQuery<'a>>) -> Self { self.mediaList = Some(mediaList); self }
pub fn build(self) -> CSSMedia<'a> {
CSSMedia {
text: self.text,
source: self.source,
sourceURL: self.sourceURL,
range: self.range,
styleSheetId: self.styleSheetId,
mediaList: self.mediaList,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct MediaQuery<'a> {
expressions: Vec<MediaQueryExpression<'a>>,
active: bool,
}
impl<'a> MediaQuery<'a> {
pub fn builder(expressions: Vec<MediaQueryExpression<'a>>, active: bool) -> MediaQueryBuilder<'a> {
MediaQueryBuilder {
expressions: expressions,
active: active,
}
}
pub fn expressions(&self) -> &[MediaQueryExpression<'a>] { &self.expressions }
pub fn active(&self) -> bool { self.active }
}
pub struct MediaQueryBuilder<'a> {
expressions: Vec<MediaQueryExpression<'a>>,
active: bool,
}
impl<'a> MediaQueryBuilder<'a> {
pub fn build(self) -> MediaQuery<'a> {
MediaQuery {
expressions: self.expressions,
active: self.active,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct MediaQueryExpression<'a> {
value: f64,
unit: Cow<'a, str>,
feature: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
valueRange: Option<SourceRange>,
#[serde(skip_serializing_if = "Option::is_none")]
computedLength: Option<f64>,
}
impl<'a> MediaQueryExpression<'a> {
pub fn builder(value: f64, unit: impl Into<Cow<'a, str>>, feature: impl Into<Cow<'a, str>>) -> MediaQueryExpressionBuilder<'a> {
MediaQueryExpressionBuilder {
value: value,
unit: unit.into(),
feature: feature.into(),
valueRange: None,
computedLength: None,
}
}
pub fn value(&self) -> f64 { self.value }
pub fn unit(&self) -> &str { self.unit.as_ref() }
pub fn feature(&self) -> &str { self.feature.as_ref() }
pub fn valueRange(&self) -> Option<&SourceRange> { self.valueRange.as_ref() }
pub fn computedLength(&self) -> Option<f64> { self.computedLength }
}
pub struct MediaQueryExpressionBuilder<'a> {
value: f64,
unit: Cow<'a, str>,
feature: Cow<'a, str>,
valueRange: Option<SourceRange>,
computedLength: Option<f64>,
}
impl<'a> MediaQueryExpressionBuilder<'a> {
pub fn valueRange(mut self, valueRange: SourceRange) -> Self { self.valueRange = Some(valueRange); self }
pub fn computedLength(mut self, computedLength: f64) -> Self { self.computedLength = Some(computedLength); self }
pub fn build(self) -> MediaQueryExpression<'a> {
MediaQueryExpression {
value: self.value,
unit: self.unit,
feature: self.feature,
valueRange: self.valueRange,
computedLength: self.computedLength,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSContainerQuery<'a> {
text: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
range: Option<SourceRange>,
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
name: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none")]
physicalAxes: Option<crate::dom::PhysicalAxes>,
#[serde(skip_serializing_if = "Option::is_none")]
logicalAxes: Option<crate::dom::LogicalAxes>,
#[serde(skip_serializing_if = "Option::is_none")]
queriesScrollState: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
queriesAnchored: Option<bool>,
}
impl<'a> CSSContainerQuery<'a> {
pub fn builder(text: impl Into<Cow<'a, str>>) -> CSSContainerQueryBuilder<'a> {
CSSContainerQueryBuilder {
text: text.into(),
range: None,
styleSheetId: None,
name: None,
physicalAxes: None,
logicalAxes: None,
queriesScrollState: None,
queriesAnchored: None,
}
}
pub fn text(&self) -> &str { self.text.as_ref() }
pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
pub fn name(&self) -> Option<&str> { self.name.as_deref() }
pub fn physicalAxes(&self) -> Option<&crate::dom::PhysicalAxes> { self.physicalAxes.as_ref() }
pub fn logicalAxes(&self) -> Option<&crate::dom::LogicalAxes> { self.logicalAxes.as_ref() }
pub fn queriesScrollState(&self) -> Option<bool> { self.queriesScrollState }
pub fn queriesAnchored(&self) -> Option<bool> { self.queriesAnchored }
}
pub struct CSSContainerQueryBuilder<'a> {
text: Cow<'a, str>,
range: Option<SourceRange>,
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
name: Option<Cow<'a, str>>,
physicalAxes: Option<crate::dom::PhysicalAxes>,
logicalAxes: Option<crate::dom::LogicalAxes>,
queriesScrollState: Option<bool>,
queriesAnchored: Option<bool>,
}
impl<'a> CSSContainerQueryBuilder<'a> {
pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn name(mut self, name: impl Into<Cow<'a, str>>) -> Self { self.name = Some(name.into()); self }
pub fn physicalAxes(mut self, physicalAxes: crate::dom::PhysicalAxes) -> Self { self.physicalAxes = Some(physicalAxes); self }
pub fn logicalAxes(mut self, logicalAxes: crate::dom::LogicalAxes) -> Self { self.logicalAxes = Some(logicalAxes); self }
pub fn queriesScrollState(mut self, queriesScrollState: bool) -> Self { self.queriesScrollState = Some(queriesScrollState); self }
pub fn queriesAnchored(mut self, queriesAnchored: bool) -> Self { self.queriesAnchored = Some(queriesAnchored); self }
pub fn build(self) -> CSSContainerQuery<'a> {
CSSContainerQuery {
text: self.text,
range: self.range,
styleSheetId: self.styleSheetId,
name: self.name,
physicalAxes: self.physicalAxes,
logicalAxes: self.logicalAxes,
queriesScrollState: self.queriesScrollState,
queriesAnchored: self.queriesAnchored,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSSupports<'a> {
text: Cow<'a, str>,
active: bool,
#[serde(skip_serializing_if = "Option::is_none")]
range: Option<SourceRange>,
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
}
impl<'a> CSSSupports<'a> {
pub fn builder(text: impl Into<Cow<'a, str>>, active: bool) -> CSSSupportsBuilder<'a> {
CSSSupportsBuilder {
text: text.into(),
active: active,
range: None,
styleSheetId: None,
}
}
pub fn text(&self) -> &str { self.text.as_ref() }
pub fn active(&self) -> bool { self.active }
pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
}
pub struct CSSSupportsBuilder<'a> {
text: Cow<'a, str>,
active: bool,
range: Option<SourceRange>,
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
}
impl<'a> CSSSupportsBuilder<'a> {
pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn build(self) -> CSSSupports<'a> {
CSSSupports {
text: self.text,
active: self.active,
range: self.range,
styleSheetId: self.styleSheetId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSNavigation<'a> {
text: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
active: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
range: Option<SourceRange>,
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
}
impl<'a> CSSNavigation<'a> {
pub fn builder(text: impl Into<Cow<'a, str>>) -> CSSNavigationBuilder<'a> {
CSSNavigationBuilder {
text: text.into(),
active: None,
range: None,
styleSheetId: None,
}
}
pub fn text(&self) -> &str { self.text.as_ref() }
pub fn active(&self) -> Option<bool> { self.active }
pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
}
pub struct CSSNavigationBuilder<'a> {
text: Cow<'a, str>,
active: Option<bool>,
range: Option<SourceRange>,
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
}
impl<'a> CSSNavigationBuilder<'a> {
pub fn active(mut self, active: bool) -> Self { self.active = Some(active); self }
pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn build(self) -> CSSNavigation<'a> {
CSSNavigation {
text: self.text,
active: self.active,
range: self.range,
styleSheetId: self.styleSheetId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSScope<'a> {
text: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
range: Option<SourceRange>,
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
}
impl<'a> CSSScope<'a> {
pub fn builder(text: impl Into<Cow<'a, str>>) -> CSSScopeBuilder<'a> {
CSSScopeBuilder {
text: text.into(),
range: None,
styleSheetId: None,
}
}
pub fn text(&self) -> &str { self.text.as_ref() }
pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
}
pub struct CSSScopeBuilder<'a> {
text: Cow<'a, str>,
range: Option<SourceRange>,
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
}
impl<'a> CSSScopeBuilder<'a> {
pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn build(self) -> CSSScope<'a> {
CSSScope {
text: self.text,
range: self.range,
styleSheetId: self.styleSheetId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSLayer<'a> {
text: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
range: Option<SourceRange>,
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
}
impl<'a> CSSLayer<'a> {
pub fn builder(text: impl Into<Cow<'a, str>>) -> CSSLayerBuilder<'a> {
CSSLayerBuilder {
text: text.into(),
range: None,
styleSheetId: None,
}
}
pub fn text(&self) -> &str { self.text.as_ref() }
pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
}
pub struct CSSLayerBuilder<'a> {
text: Cow<'a, str>,
range: Option<SourceRange>,
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
}
impl<'a> CSSLayerBuilder<'a> {
pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn build(self) -> CSSLayer<'a> {
CSSLayer {
text: self.text,
range: self.range,
styleSheetId: self.styleSheetId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSStartingStyle<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
range: Option<SourceRange>,
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
}
impl<'a> CSSStartingStyle<'a> {
pub fn builder() -> CSSStartingStyleBuilder<'a> {
CSSStartingStyleBuilder {
range: None,
styleSheetId: None,
}
}
pub fn range(&self) -> Option<&SourceRange> { self.range.as_ref() }
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
}
#[derive(Default)]
pub struct CSSStartingStyleBuilder<'a> {
range: Option<SourceRange>,
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
}
impl<'a> CSSStartingStyleBuilder<'a> {
pub fn range(mut self, range: SourceRange) -> Self { self.range = Some(range); self }
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn build(self) -> CSSStartingStyle<'a> {
CSSStartingStyle {
range: self.range,
styleSheetId: self.styleSheetId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSLayerData<'a> {
name: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
subLayers: Option<Vec<Box<CSSLayerData<'a>>>>,
order: f64,
}
impl<'a> CSSLayerData<'a> {
pub fn builder(name: impl Into<Cow<'a, str>>, order: f64) -> CSSLayerDataBuilder<'a> {
CSSLayerDataBuilder {
name: name.into(),
subLayers: None,
order: order,
}
}
pub fn name(&self) -> &str { self.name.as_ref() }
pub fn subLayers(&self) -> Option<&[Box<CSSLayerData<'a>>]> { self.subLayers.as_deref() }
pub fn order(&self) -> f64 { self.order }
}
pub struct CSSLayerDataBuilder<'a> {
name: Cow<'a, str>,
subLayers: Option<Vec<Box<CSSLayerData<'a>>>>,
order: f64,
}
impl<'a> CSSLayerDataBuilder<'a> {
pub fn subLayers(mut self, subLayers: Vec<Box<CSSLayerData<'a>>>) -> Self { self.subLayers = Some(subLayers); self }
pub fn build(self) -> CSSLayerData<'a> {
CSSLayerData {
name: self.name,
subLayers: self.subLayers,
order: self.order,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct PlatformFontUsage<'a> {
familyName: Cow<'a, str>,
postScriptName: Cow<'a, str>,
isCustomFont: bool,
glyphCount: f64,
}
impl<'a> PlatformFontUsage<'a> {
pub fn builder(familyName: impl Into<Cow<'a, str>>, postScriptName: impl Into<Cow<'a, str>>, isCustomFont: bool, glyphCount: f64) -> PlatformFontUsageBuilder<'a> {
PlatformFontUsageBuilder {
familyName: familyName.into(),
postScriptName: postScriptName.into(),
isCustomFont: isCustomFont,
glyphCount: glyphCount,
}
}
pub fn familyName(&self) -> &str { self.familyName.as_ref() }
pub fn postScriptName(&self) -> &str { self.postScriptName.as_ref() }
pub fn isCustomFont(&self) -> bool { self.isCustomFont }
pub fn glyphCount(&self) -> f64 { self.glyphCount }
}
pub struct PlatformFontUsageBuilder<'a> {
familyName: Cow<'a, str>,
postScriptName: Cow<'a, str>,
isCustomFont: bool,
glyphCount: f64,
}
impl<'a> PlatformFontUsageBuilder<'a> {
pub fn build(self) -> PlatformFontUsage<'a> {
PlatformFontUsage {
familyName: self.familyName,
postScriptName: self.postScriptName,
isCustomFont: self.isCustomFont,
glyphCount: self.glyphCount,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct FontVariationAxis<'a> {
tag: Cow<'a, str>,
name: Cow<'a, str>,
minValue: f64,
maxValue: f64,
defaultValue: f64,
}
impl<'a> FontVariationAxis<'a> {
pub fn builder(tag: impl Into<Cow<'a, str>>, name: impl Into<Cow<'a, str>>, minValue: f64, maxValue: f64, defaultValue: f64) -> FontVariationAxisBuilder<'a> {
FontVariationAxisBuilder {
tag: tag.into(),
name: name.into(),
minValue: minValue,
maxValue: maxValue,
defaultValue: defaultValue,
}
}
pub fn tag(&self) -> &str { self.tag.as_ref() }
pub fn name(&self) -> &str { self.name.as_ref() }
pub fn minValue(&self) -> f64 { self.minValue }
pub fn maxValue(&self) -> f64 { self.maxValue }
pub fn defaultValue(&self) -> f64 { self.defaultValue }
}
pub struct FontVariationAxisBuilder<'a> {
tag: Cow<'a, str>,
name: Cow<'a, str>,
minValue: f64,
maxValue: f64,
defaultValue: f64,
}
impl<'a> FontVariationAxisBuilder<'a> {
pub fn build(self) -> FontVariationAxis<'a> {
FontVariationAxis {
tag: self.tag,
name: self.name,
minValue: self.minValue,
maxValue: self.maxValue,
defaultValue: self.defaultValue,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct FontFace<'a> {
fontFamily: Cow<'a, str>,
fontStyle: Cow<'a, str>,
fontVariant: Cow<'a, str>,
fontWeight: Cow<'a, str>,
fontStretch: Cow<'a, str>,
fontDisplay: Cow<'a, str>,
unicodeRange: Cow<'a, str>,
src: Cow<'a, str>,
platformFontFamily: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
fontVariationAxes: Option<Vec<FontVariationAxis<'a>>>,
}
impl<'a> FontFace<'a> {
pub fn builder(fontFamily: impl Into<Cow<'a, str>>, fontStyle: impl Into<Cow<'a, str>>, fontVariant: impl Into<Cow<'a, str>>, fontWeight: impl Into<Cow<'a, str>>, fontStretch: impl Into<Cow<'a, str>>, fontDisplay: impl Into<Cow<'a, str>>, unicodeRange: impl Into<Cow<'a, str>>, src: impl Into<Cow<'a, str>>, platformFontFamily: impl Into<Cow<'a, str>>) -> FontFaceBuilder<'a> {
FontFaceBuilder {
fontFamily: fontFamily.into(),
fontStyle: fontStyle.into(),
fontVariant: fontVariant.into(),
fontWeight: fontWeight.into(),
fontStretch: fontStretch.into(),
fontDisplay: fontDisplay.into(),
unicodeRange: unicodeRange.into(),
src: src.into(),
platformFontFamily: platformFontFamily.into(),
fontVariationAxes: None,
}
}
pub fn fontFamily(&self) -> &str { self.fontFamily.as_ref() }
pub fn fontStyle(&self) -> &str { self.fontStyle.as_ref() }
pub fn fontVariant(&self) -> &str { self.fontVariant.as_ref() }
pub fn fontWeight(&self) -> &str { self.fontWeight.as_ref() }
pub fn fontStretch(&self) -> &str { self.fontStretch.as_ref() }
pub fn fontDisplay(&self) -> &str { self.fontDisplay.as_ref() }
pub fn unicodeRange(&self) -> &str { self.unicodeRange.as_ref() }
pub fn src(&self) -> &str { self.src.as_ref() }
pub fn platformFontFamily(&self) -> &str { self.platformFontFamily.as_ref() }
pub fn fontVariationAxes(&self) -> Option<&[FontVariationAxis<'a>]> { self.fontVariationAxes.as_deref() }
}
pub struct FontFaceBuilder<'a> {
fontFamily: Cow<'a, str>,
fontStyle: Cow<'a, str>,
fontVariant: Cow<'a, str>,
fontWeight: Cow<'a, str>,
fontStretch: Cow<'a, str>,
fontDisplay: Cow<'a, str>,
unicodeRange: Cow<'a, str>,
src: Cow<'a, str>,
platformFontFamily: Cow<'a, str>,
fontVariationAxes: Option<Vec<FontVariationAxis<'a>>>,
}
impl<'a> FontFaceBuilder<'a> {
pub fn fontVariationAxes(mut self, fontVariationAxes: Vec<FontVariationAxis<'a>>) -> Self { self.fontVariationAxes = Some(fontVariationAxes); self }
pub fn build(self) -> FontFace<'a> {
FontFace {
fontFamily: self.fontFamily,
fontStyle: self.fontStyle,
fontVariant: self.fontVariant,
fontWeight: self.fontWeight,
fontStretch: self.fontStretch,
fontDisplay: self.fontDisplay,
unicodeRange: self.unicodeRange,
src: self.src,
platformFontFamily: self.platformFontFamily,
fontVariationAxes: self.fontVariationAxes,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSTryRule<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
origin: StyleSheetOrigin,
style: CSSStyle<'a>,
}
impl<'a> CSSTryRule<'a> {
pub fn builder(origin: StyleSheetOrigin, style: CSSStyle<'a>) -> CSSTryRuleBuilder<'a> {
CSSTryRuleBuilder {
styleSheetId: None,
origin: origin,
style: style,
}
}
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
pub fn style(&self) -> &CSSStyle<'a> { &self.style }
}
pub struct CSSTryRuleBuilder<'a> {
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
origin: StyleSheetOrigin,
style: CSSStyle<'a>,
}
impl<'a> CSSTryRuleBuilder<'a> {
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn build(self) -> CSSTryRule<'a> {
CSSTryRule {
styleSheetId: self.styleSheetId,
origin: self.origin,
style: self.style,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSPositionTryRule<'a> {
name: ProtocolValue<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
origin: StyleSheetOrigin,
style: CSSStyle<'a>,
active: bool,
}
impl<'a> CSSPositionTryRule<'a> {
pub fn builder(name: ProtocolValue<'a>, origin: StyleSheetOrigin, style: CSSStyle<'a>, active: bool) -> CSSPositionTryRuleBuilder<'a> {
CSSPositionTryRuleBuilder {
name: name,
styleSheetId: None,
origin: origin,
style: style,
active: active,
}
}
pub fn name(&self) -> &ProtocolValue<'a> { &self.name }
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
pub fn style(&self) -> &CSSStyle<'a> { &self.style }
pub fn active(&self) -> bool { self.active }
}
pub struct CSSPositionTryRuleBuilder<'a> {
name: ProtocolValue<'a>,
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
origin: StyleSheetOrigin,
style: CSSStyle<'a>,
active: bool,
}
impl<'a> CSSPositionTryRuleBuilder<'a> {
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn build(self) -> CSSPositionTryRule<'a> {
CSSPositionTryRule {
name: self.name,
styleSheetId: self.styleSheetId,
origin: self.origin,
style: self.style,
active: self.active,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSKeyframesRule<'a> {
animationName: ProtocolValue<'a>,
keyframes: Vec<CSSKeyframeRule<'a>>,
}
impl<'a> CSSKeyframesRule<'a> {
pub fn builder(animationName: ProtocolValue<'a>, keyframes: Vec<CSSKeyframeRule<'a>>) -> CSSKeyframesRuleBuilder<'a> {
CSSKeyframesRuleBuilder {
animationName: animationName,
keyframes: keyframes,
}
}
pub fn animationName(&self) -> &ProtocolValue<'a> { &self.animationName }
pub fn keyframes(&self) -> &[CSSKeyframeRule<'a>] { &self.keyframes }
}
pub struct CSSKeyframesRuleBuilder<'a> {
animationName: ProtocolValue<'a>,
keyframes: Vec<CSSKeyframeRule<'a>>,
}
impl<'a> CSSKeyframesRuleBuilder<'a> {
pub fn build(self) -> CSSKeyframesRule<'a> {
CSSKeyframesRule {
animationName: self.animationName,
keyframes: self.keyframes,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSPropertyRegistration<'a> {
propertyName: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
initialValue: Option<ProtocolValue<'a>>,
inherits: bool,
syntax: Cow<'a, str>,
}
impl<'a> CSSPropertyRegistration<'a> {
pub fn builder(propertyName: impl Into<Cow<'a, str>>, inherits: bool, syntax: impl Into<Cow<'a, str>>) -> CSSPropertyRegistrationBuilder<'a> {
CSSPropertyRegistrationBuilder {
propertyName: propertyName.into(),
initialValue: None,
inherits: inherits,
syntax: syntax.into(),
}
}
pub fn propertyName(&self) -> &str { self.propertyName.as_ref() }
pub fn initialValue(&self) -> Option<&ProtocolValue<'a>> { self.initialValue.as_ref() }
pub fn inherits(&self) -> bool { self.inherits }
pub fn syntax(&self) -> &str { self.syntax.as_ref() }
}
pub struct CSSPropertyRegistrationBuilder<'a> {
propertyName: Cow<'a, str>,
initialValue: Option<ProtocolValue<'a>>,
inherits: bool,
syntax: Cow<'a, str>,
}
impl<'a> CSSPropertyRegistrationBuilder<'a> {
pub fn initialValue(mut self, initialValue: ProtocolValue<'a>) -> Self { self.initialValue = Some(initialValue); self }
pub fn build(self) -> CSSPropertyRegistration<'a> {
CSSPropertyRegistration {
propertyName: self.propertyName,
initialValue: self.initialValue,
inherits: self.inherits,
syntax: self.syntax,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSAtRule<'a> {
#[serde(rename = "type")]
type_: Cow<'a, str>,
#[serde(skip_serializing_if = "Option::is_none")]
subsection: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none")]
name: Option<ProtocolValue<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
origin: StyleSheetOrigin,
style: CSSStyle<'a>,
}
impl<'a> CSSAtRule<'a> {
pub fn builder(type_: impl Into<Cow<'a, str>>, origin: StyleSheetOrigin, style: CSSStyle<'a>) -> CSSAtRuleBuilder<'a> {
CSSAtRuleBuilder {
type_: type_.into(),
subsection: None,
name: None,
styleSheetId: None,
origin: origin,
style: style,
}
}
pub fn type_(&self) -> &str { self.type_.as_ref() }
pub fn subsection(&self) -> Option<&str> { self.subsection.as_deref() }
pub fn name(&self) -> Option<&ProtocolValue<'a>> { self.name.as_ref() }
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
pub fn style(&self) -> &CSSStyle<'a> { &self.style }
}
pub struct CSSAtRuleBuilder<'a> {
type_: Cow<'a, str>,
subsection: Option<Cow<'a, str>>,
name: Option<ProtocolValue<'a>>,
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
origin: StyleSheetOrigin,
style: CSSStyle<'a>,
}
impl<'a> CSSAtRuleBuilder<'a> {
pub fn subsection(mut self, subsection: impl Into<Cow<'a, str>>) -> Self { self.subsection = Some(subsection.into()); self }
pub fn name(mut self, name: ProtocolValue<'a>) -> Self { self.name = Some(name); self }
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn build(self) -> CSSAtRule<'a> {
CSSAtRule {
type_: self.type_,
subsection: self.subsection,
name: self.name,
styleSheetId: self.styleSheetId,
origin: self.origin,
style: self.style,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSPropertyRule<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
origin: StyleSheetOrigin,
propertyName: ProtocolValue<'a>,
style: CSSStyle<'a>,
}
impl<'a> CSSPropertyRule<'a> {
pub fn builder(origin: StyleSheetOrigin, propertyName: ProtocolValue<'a>, style: CSSStyle<'a>) -> CSSPropertyRuleBuilder<'a> {
CSSPropertyRuleBuilder {
styleSheetId: None,
origin: origin,
propertyName: propertyName,
style: style,
}
}
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
pub fn propertyName(&self) -> &ProtocolValue<'a> { &self.propertyName }
pub fn style(&self) -> &CSSStyle<'a> { &self.style }
}
pub struct CSSPropertyRuleBuilder<'a> {
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
origin: StyleSheetOrigin,
propertyName: ProtocolValue<'a>,
style: CSSStyle<'a>,
}
impl<'a> CSSPropertyRuleBuilder<'a> {
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn build(self) -> CSSPropertyRule<'a> {
CSSPropertyRule {
styleSheetId: self.styleSheetId,
origin: self.origin,
propertyName: self.propertyName,
style: self.style,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSFunctionParameter<'a> {
name: Cow<'a, str>,
#[serde(rename = "type")]
type_: Cow<'a, str>,
}
impl<'a> CSSFunctionParameter<'a> {
pub fn builder(name: impl Into<Cow<'a, str>>, type_: impl Into<Cow<'a, str>>) -> CSSFunctionParameterBuilder<'a> {
CSSFunctionParameterBuilder {
name: name.into(),
type_: type_.into(),
}
}
pub fn name(&self) -> &str { self.name.as_ref() }
pub fn type_(&self) -> &str { self.type_.as_ref() }
}
pub struct CSSFunctionParameterBuilder<'a> {
name: Cow<'a, str>,
type_: Cow<'a, str>,
}
impl<'a> CSSFunctionParameterBuilder<'a> {
pub fn build(self) -> CSSFunctionParameter<'a> {
CSSFunctionParameter {
name: self.name,
type_: self.type_,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSFunctionConditionNode<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
media: Option<CSSMedia<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
containerQueries: Option<CSSContainerQuery<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
supports: Option<CSSSupports<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
navigation: Option<CSSNavigation<'a>>,
children: Vec<CSSFunctionNode<'a>>,
conditionText: Cow<'a, str>,
}
impl<'a> CSSFunctionConditionNode<'a> {
pub fn builder(children: Vec<CSSFunctionNode<'a>>, conditionText: impl Into<Cow<'a, str>>) -> CSSFunctionConditionNodeBuilder<'a> {
CSSFunctionConditionNodeBuilder {
media: None,
containerQueries: None,
supports: None,
navigation: None,
children: children,
conditionText: conditionText.into(),
}
}
pub fn media(&self) -> Option<&CSSMedia<'a>> { self.media.as_ref() }
pub fn containerQueries(&self) -> Option<&CSSContainerQuery<'a>> { self.containerQueries.as_ref() }
pub fn supports(&self) -> Option<&CSSSupports<'a>> { self.supports.as_ref() }
pub fn navigation(&self) -> Option<&CSSNavigation<'a>> { self.navigation.as_ref() }
pub fn children(&self) -> &[CSSFunctionNode<'a>] { &self.children }
pub fn conditionText(&self) -> &str { self.conditionText.as_ref() }
}
pub struct CSSFunctionConditionNodeBuilder<'a> {
media: Option<CSSMedia<'a>>,
containerQueries: Option<CSSContainerQuery<'a>>,
supports: Option<CSSSupports<'a>>,
navigation: Option<CSSNavigation<'a>>,
children: Vec<CSSFunctionNode<'a>>,
conditionText: Cow<'a, str>,
}
impl<'a> CSSFunctionConditionNodeBuilder<'a> {
pub fn media(mut self, media: CSSMedia<'a>) -> Self { self.media = Some(media); self }
pub fn containerQueries(mut self, containerQueries: CSSContainerQuery<'a>) -> Self { self.containerQueries = Some(containerQueries); self }
pub fn supports(mut self, supports: CSSSupports<'a>) -> Self { self.supports = Some(supports); self }
pub fn navigation(mut self, navigation: CSSNavigation<'a>) -> Self { self.navigation = Some(navigation); self }
pub fn build(self) -> CSSFunctionConditionNode<'a> {
CSSFunctionConditionNode {
media: self.media,
containerQueries: self.containerQueries,
supports: self.supports,
navigation: self.navigation,
children: self.children,
conditionText: self.conditionText,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSFunctionNode<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
condition: Option<CSSFunctionConditionNode<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
style: Option<CSSStyle<'a>>,
}
impl<'a> CSSFunctionNode<'a> {
pub fn builder() -> CSSFunctionNodeBuilder<'a> {
CSSFunctionNodeBuilder {
condition: None,
style: None,
}
}
pub fn condition(&self) -> Option<&CSSFunctionConditionNode<'a>> { self.condition.as_ref() }
pub fn style(&self) -> Option<&CSSStyle<'a>> { self.style.as_ref() }
}
#[derive(Default)]
pub struct CSSFunctionNodeBuilder<'a> {
condition: Option<CSSFunctionConditionNode<'a>>,
style: Option<CSSStyle<'a>>,
}
impl<'a> CSSFunctionNodeBuilder<'a> {
pub fn condition(mut self, condition: CSSFunctionConditionNode<'a>) -> Self { self.condition = Some(condition); self }
pub fn style(mut self, style: CSSStyle<'a>) -> Self { self.style = Some(style); self }
pub fn build(self) -> CSSFunctionNode<'a> {
CSSFunctionNode {
condition: self.condition,
style: self.style,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSFunctionRule<'a> {
name: ProtocolValue<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
origin: StyleSheetOrigin,
parameters: Vec<CSSFunctionParameter<'a>>,
children: Vec<CSSFunctionNode<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
originTreeScopeNodeId: Option<crate::dom::BackendNodeId>,
}
impl<'a> CSSFunctionRule<'a> {
pub fn builder(name: ProtocolValue<'a>, origin: StyleSheetOrigin, parameters: Vec<CSSFunctionParameter<'a>>, children: Vec<CSSFunctionNode<'a>>) -> CSSFunctionRuleBuilder<'a> {
CSSFunctionRuleBuilder {
name: name,
styleSheetId: None,
origin: origin,
parameters: parameters,
children: children,
originTreeScopeNodeId: None,
}
}
pub fn name(&self) -> &ProtocolValue<'a> { &self.name }
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
pub fn parameters(&self) -> &[CSSFunctionParameter<'a>] { &self.parameters }
pub fn children(&self) -> &[CSSFunctionNode<'a>] { &self.children }
pub fn originTreeScopeNodeId(&self) -> Option<&crate::dom::BackendNodeId> { self.originTreeScopeNodeId.as_ref() }
}
pub struct CSSFunctionRuleBuilder<'a> {
name: ProtocolValue<'a>,
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
origin: StyleSheetOrigin,
parameters: Vec<CSSFunctionParameter<'a>>,
children: Vec<CSSFunctionNode<'a>>,
originTreeScopeNodeId: Option<crate::dom::BackendNodeId>,
}
impl<'a> CSSFunctionRuleBuilder<'a> {
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn originTreeScopeNodeId(mut self, originTreeScopeNodeId: crate::dom::BackendNodeId) -> Self { self.originTreeScopeNodeId = Some(originTreeScopeNodeId); self }
pub fn build(self) -> CSSFunctionRule<'a> {
CSSFunctionRule {
name: self.name,
styleSheetId: self.styleSheetId,
origin: self.origin,
parameters: self.parameters,
children: self.children,
originTreeScopeNodeId: self.originTreeScopeNodeId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CSSKeyframeRule<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
origin: StyleSheetOrigin,
keyText: ProtocolValue<'a>,
style: CSSStyle<'a>,
}
impl<'a> CSSKeyframeRule<'a> {
pub fn builder(origin: StyleSheetOrigin, keyText: ProtocolValue<'a>, style: CSSStyle<'a>) -> CSSKeyframeRuleBuilder<'a> {
CSSKeyframeRuleBuilder {
styleSheetId: None,
origin: origin,
keyText: keyText,
style: style,
}
}
pub fn styleSheetId(&self) -> Option<&crate::dom::StyleSheetId<'a>> { self.styleSheetId.as_ref() }
pub fn origin(&self) -> &StyleSheetOrigin { &self.origin }
pub fn keyText(&self) -> &ProtocolValue<'a> { &self.keyText }
pub fn style(&self) -> &CSSStyle<'a> { &self.style }
}
pub struct CSSKeyframeRuleBuilder<'a> {
styleSheetId: Option<crate::dom::StyleSheetId<'a>>,
origin: StyleSheetOrigin,
keyText: ProtocolValue<'a>,
style: CSSStyle<'a>,
}
impl<'a> CSSKeyframeRuleBuilder<'a> {
pub fn styleSheetId(mut self, styleSheetId: crate::dom::StyleSheetId<'a>) -> Self { self.styleSheetId = Some(styleSheetId); self }
pub fn build(self) -> CSSKeyframeRule<'a> {
CSSKeyframeRule {
styleSheetId: self.styleSheetId,
origin: self.origin,
keyText: self.keyText,
style: self.style,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct StyleDeclarationEdit<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
text: Cow<'a, str>,
}
impl<'a> StyleDeclarationEdit<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>, range: SourceRange, text: impl Into<Cow<'a, str>>) -> StyleDeclarationEditBuilder<'a> {
StyleDeclarationEditBuilder {
styleSheetId: styleSheetId,
range: range,
text: text.into(),
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
pub fn range(&self) -> &SourceRange { &self.range }
pub fn text(&self) -> &str { self.text.as_ref() }
}
pub struct StyleDeclarationEditBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
text: Cow<'a, str>,
}
impl<'a> StyleDeclarationEditBuilder<'a> {
pub fn build(self) -> StyleDeclarationEdit<'a> {
StyleDeclarationEdit {
styleSheetId: self.styleSheetId,
range: self.range,
text: self.text,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AddRuleParams<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
ruleText: Cow<'a, str>,
location: SourceRange,
#[serde(skip_serializing_if = "Option::is_none")]
nodeForPropertySyntaxValidation: Option<crate::dom::NodeId>,
}
impl<'a> AddRuleParams<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>, ruleText: impl Into<Cow<'a, str>>, location: SourceRange) -> AddRuleParamsBuilder<'a> {
AddRuleParamsBuilder {
styleSheetId: styleSheetId,
ruleText: ruleText.into(),
location: location,
nodeForPropertySyntaxValidation: None,
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
pub fn ruleText(&self) -> &str { self.ruleText.as_ref() }
pub fn location(&self) -> &SourceRange { &self.location }
pub fn nodeForPropertySyntaxValidation(&self) -> Option<&crate::dom::NodeId> { self.nodeForPropertySyntaxValidation.as_ref() }
}
pub struct AddRuleParamsBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
ruleText: Cow<'a, str>,
location: SourceRange,
nodeForPropertySyntaxValidation: Option<crate::dom::NodeId>,
}
impl<'a> AddRuleParamsBuilder<'a> {
pub fn nodeForPropertySyntaxValidation(mut self, nodeForPropertySyntaxValidation: crate::dom::NodeId) -> Self { self.nodeForPropertySyntaxValidation = Some(nodeForPropertySyntaxValidation); self }
pub fn build(self) -> AddRuleParams<'a> {
AddRuleParams {
styleSheetId: self.styleSheetId,
ruleText: self.ruleText,
location: self.location,
nodeForPropertySyntaxValidation: self.nodeForPropertySyntaxValidation,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AddRuleReturns<'a> {
rule: CSSRule<'a>,
}
impl<'a> AddRuleReturns<'a> {
pub fn builder(rule: CSSRule<'a>) -> AddRuleReturnsBuilder<'a> {
AddRuleReturnsBuilder {
rule: rule,
}
}
pub fn rule(&self) -> &CSSRule<'a> { &self.rule }
}
pub struct AddRuleReturnsBuilder<'a> {
rule: CSSRule<'a>,
}
impl<'a> AddRuleReturnsBuilder<'a> {
pub fn build(self) -> AddRuleReturns<'a> {
AddRuleReturns {
rule: self.rule,
}
}
}
impl<'a> AddRuleParams<'a> { pub const METHOD: &'static str = "CSS.addRule"; }
impl<'a> crate::CdpCommand<'a> for AddRuleParams<'a> {
const METHOD: &'static str = "CSS.addRule";
type Response = AddRuleReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CollectClassNamesParams<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
}
impl<'a> CollectClassNamesParams<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>) -> CollectClassNamesParamsBuilder<'a> {
CollectClassNamesParamsBuilder {
styleSheetId: styleSheetId,
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
}
pub struct CollectClassNamesParamsBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
}
impl<'a> CollectClassNamesParamsBuilder<'a> {
pub fn build(self) -> CollectClassNamesParams<'a> {
CollectClassNamesParams {
styleSheetId: self.styleSheetId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CollectClassNamesReturns<'a> {
classNames: Vec<Cow<'a, str>>,
}
impl<'a> CollectClassNamesReturns<'a> {
pub fn builder(classNames: Vec<Cow<'a, str>>) -> CollectClassNamesReturnsBuilder<'a> {
CollectClassNamesReturnsBuilder {
classNames: classNames,
}
}
pub fn classNames(&self) -> &[Cow<'a, str>] { &self.classNames }
}
pub struct CollectClassNamesReturnsBuilder<'a> {
classNames: Vec<Cow<'a, str>>,
}
impl<'a> CollectClassNamesReturnsBuilder<'a> {
pub fn build(self) -> CollectClassNamesReturns<'a> {
CollectClassNamesReturns {
classNames: self.classNames,
}
}
}
impl<'a> CollectClassNamesParams<'a> { pub const METHOD: &'static str = "CSS.collectClassNames"; }
impl<'a> crate::CdpCommand<'a> for CollectClassNamesParams<'a> {
const METHOD: &'static str = "CSS.collectClassNames";
type Response = CollectClassNamesReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CreateStyleSheetParams<'a> {
frameId: crate::page::FrameId<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
force: Option<bool>,
}
impl<'a> CreateStyleSheetParams<'a> {
pub fn builder(frameId: crate::page::FrameId<'a>) -> CreateStyleSheetParamsBuilder<'a> {
CreateStyleSheetParamsBuilder {
frameId: frameId,
force: None,
}
}
pub fn frameId(&self) -> &crate::page::FrameId<'a> { &self.frameId }
pub fn force(&self) -> Option<bool> { self.force }
}
pub struct CreateStyleSheetParamsBuilder<'a> {
frameId: crate::page::FrameId<'a>,
force: Option<bool>,
}
impl<'a> CreateStyleSheetParamsBuilder<'a> {
pub fn force(mut self, force: bool) -> Self { self.force = Some(force); self }
pub fn build(self) -> CreateStyleSheetParams<'a> {
CreateStyleSheetParams {
frameId: self.frameId,
force: self.force,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CreateStyleSheetReturns<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
}
impl<'a> CreateStyleSheetReturns<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>) -> CreateStyleSheetReturnsBuilder<'a> {
CreateStyleSheetReturnsBuilder {
styleSheetId: styleSheetId,
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
}
pub struct CreateStyleSheetReturnsBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
}
impl<'a> CreateStyleSheetReturnsBuilder<'a> {
pub fn build(self) -> CreateStyleSheetReturns<'a> {
CreateStyleSheetReturns {
styleSheetId: self.styleSheetId,
}
}
}
impl<'a> CreateStyleSheetParams<'a> { pub const METHOD: &'static str = "CSS.createStyleSheet"; }
impl<'a> crate::CdpCommand<'a> for CreateStyleSheetParams<'a> {
const METHOD: &'static str = "CSS.createStyleSheet";
type Response = CreateStyleSheetReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct DisableParams {}
impl DisableParams { pub const METHOD: &'static str = "CSS.disable"; }
impl<'a> crate::CdpCommand<'a> for DisableParams {
const METHOD: &'static str = "CSS.disable";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct EnableParams {}
impl EnableParams { pub const METHOD: &'static str = "CSS.enable"; }
impl<'a> crate::CdpCommand<'a> for EnableParams {
const METHOD: &'static str = "CSS.enable";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ForcePseudoStateParams<'a> {
nodeId: crate::dom::NodeId,
forcedPseudoClasses: Vec<Cow<'a, str>>,
}
impl<'a> ForcePseudoStateParams<'a> {
pub fn builder(nodeId: crate::dom::NodeId, forcedPseudoClasses: Vec<Cow<'a, str>>) -> ForcePseudoStateParamsBuilder<'a> {
ForcePseudoStateParamsBuilder {
nodeId: nodeId,
forcedPseudoClasses: forcedPseudoClasses,
}
}
pub fn nodeId(&self) -> &crate::dom::NodeId { &self.nodeId }
pub fn forcedPseudoClasses(&self) -> &[Cow<'a, str>] { &self.forcedPseudoClasses }
}
pub struct ForcePseudoStateParamsBuilder<'a> {
nodeId: crate::dom::NodeId,
forcedPseudoClasses: Vec<Cow<'a, str>>,
}
impl<'a> ForcePseudoStateParamsBuilder<'a> {
pub fn build(self) -> ForcePseudoStateParams<'a> {
ForcePseudoStateParams {
nodeId: self.nodeId,
forcedPseudoClasses: self.forcedPseudoClasses,
}
}
}
impl<'a> ForcePseudoStateParams<'a> { pub const METHOD: &'static str = "CSS.forcePseudoState"; }
impl<'a> crate::CdpCommand<'a> for ForcePseudoStateParams<'a> {
const METHOD: &'static str = "CSS.forcePseudoState";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ForceStartingStyleParams {
nodeId: crate::dom::NodeId,
forced: bool,
}
impl ForceStartingStyleParams {
pub fn builder(nodeId: crate::dom::NodeId, forced: bool) -> ForceStartingStyleParamsBuilder {
ForceStartingStyleParamsBuilder {
nodeId: nodeId,
forced: forced,
}
}
pub fn nodeId(&self) -> &crate::dom::NodeId { &self.nodeId }
pub fn forced(&self) -> bool { self.forced }
}
pub struct ForceStartingStyleParamsBuilder {
nodeId: crate::dom::NodeId,
forced: bool,
}
impl ForceStartingStyleParamsBuilder {
pub fn build(self) -> ForceStartingStyleParams {
ForceStartingStyleParams {
nodeId: self.nodeId,
forced: self.forced,
}
}
}
impl ForceStartingStyleParams { pub const METHOD: &'static str = "CSS.forceStartingStyle"; }
impl<'a> crate::CdpCommand<'a> for ForceStartingStyleParams {
const METHOD: &'static str = "CSS.forceStartingStyle";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetBackgroundColorsParams {
nodeId: crate::dom::NodeId,
}
impl GetBackgroundColorsParams {
pub fn builder(nodeId: crate::dom::NodeId) -> GetBackgroundColorsParamsBuilder {
GetBackgroundColorsParamsBuilder {
nodeId: nodeId,
}
}
pub fn nodeId(&self) -> &crate::dom::NodeId { &self.nodeId }
}
pub struct GetBackgroundColorsParamsBuilder {
nodeId: crate::dom::NodeId,
}
impl GetBackgroundColorsParamsBuilder {
pub fn build(self) -> GetBackgroundColorsParams {
GetBackgroundColorsParams {
nodeId: self.nodeId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetBackgroundColorsReturns<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
backgroundColors: Option<Vec<Cow<'a, str>>>,
#[serde(skip_serializing_if = "Option::is_none")]
computedFontSize: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none")]
computedFontWeight: Option<Cow<'a, str>>,
}
impl<'a> GetBackgroundColorsReturns<'a> {
pub fn builder() -> GetBackgroundColorsReturnsBuilder<'a> {
GetBackgroundColorsReturnsBuilder {
backgroundColors: None,
computedFontSize: None,
computedFontWeight: None,
}
}
pub fn backgroundColors(&self) -> Option<&[Cow<'a, str>]> { self.backgroundColors.as_deref() }
pub fn computedFontSize(&self) -> Option<&str> { self.computedFontSize.as_deref() }
pub fn computedFontWeight(&self) -> Option<&str> { self.computedFontWeight.as_deref() }
}
#[derive(Default)]
pub struct GetBackgroundColorsReturnsBuilder<'a> {
backgroundColors: Option<Vec<Cow<'a, str>>>,
computedFontSize: Option<Cow<'a, str>>,
computedFontWeight: Option<Cow<'a, str>>,
}
impl<'a> GetBackgroundColorsReturnsBuilder<'a> {
pub fn backgroundColors(mut self, backgroundColors: Vec<Cow<'a, str>>) -> Self { self.backgroundColors = Some(backgroundColors); self }
pub fn computedFontSize(mut self, computedFontSize: impl Into<Cow<'a, str>>) -> Self { self.computedFontSize = Some(computedFontSize.into()); self }
pub fn computedFontWeight(mut self, computedFontWeight: impl Into<Cow<'a, str>>) -> Self { self.computedFontWeight = Some(computedFontWeight.into()); self }
pub fn build(self) -> GetBackgroundColorsReturns<'a> {
GetBackgroundColorsReturns {
backgroundColors: self.backgroundColors,
computedFontSize: self.computedFontSize,
computedFontWeight: self.computedFontWeight,
}
}
}
impl GetBackgroundColorsParams { pub const METHOD: &'static str = "CSS.getBackgroundColors"; }
impl<'a> crate::CdpCommand<'a> for GetBackgroundColorsParams {
const METHOD: &'static str = "CSS.getBackgroundColors";
type Response = GetBackgroundColorsReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetComputedStyleForNodeParams {
nodeId: crate::dom::NodeId,
}
impl GetComputedStyleForNodeParams {
pub fn builder(nodeId: crate::dom::NodeId) -> GetComputedStyleForNodeParamsBuilder {
GetComputedStyleForNodeParamsBuilder {
nodeId: nodeId,
}
}
pub fn nodeId(&self) -> &crate::dom::NodeId { &self.nodeId }
}
pub struct GetComputedStyleForNodeParamsBuilder {
nodeId: crate::dom::NodeId,
}
impl GetComputedStyleForNodeParamsBuilder {
pub fn build(self) -> GetComputedStyleForNodeParams {
GetComputedStyleForNodeParams {
nodeId: self.nodeId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetComputedStyleForNodeReturns<'a> {
computedStyle: Vec<CSSComputedStyleProperty<'a>>,
extraFields: ComputedStyleExtraFields,
}
impl<'a> GetComputedStyleForNodeReturns<'a> {
pub fn builder(computedStyle: Vec<CSSComputedStyleProperty<'a>>, extraFields: ComputedStyleExtraFields) -> GetComputedStyleForNodeReturnsBuilder<'a> {
GetComputedStyleForNodeReturnsBuilder {
computedStyle: computedStyle,
extraFields: extraFields,
}
}
pub fn computedStyle(&self) -> &[CSSComputedStyleProperty<'a>] { &self.computedStyle }
pub fn extraFields(&self) -> &ComputedStyleExtraFields { &self.extraFields }
}
pub struct GetComputedStyleForNodeReturnsBuilder<'a> {
computedStyle: Vec<CSSComputedStyleProperty<'a>>,
extraFields: ComputedStyleExtraFields,
}
impl<'a> GetComputedStyleForNodeReturnsBuilder<'a> {
pub fn build(self) -> GetComputedStyleForNodeReturns<'a> {
GetComputedStyleForNodeReturns {
computedStyle: self.computedStyle,
extraFields: self.extraFields,
}
}
}
impl GetComputedStyleForNodeParams { pub const METHOD: &'static str = "CSS.getComputedStyleForNode"; }
impl<'a> crate::CdpCommand<'a> for GetComputedStyleForNodeParams {
const METHOD: &'static str = "CSS.getComputedStyleForNode";
type Response = GetComputedStyleForNodeReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ResolveValuesParams<'a> {
values: Vec<Cow<'a, str>>,
nodeId: crate::dom::NodeId,
#[serde(skip_serializing_if = "Option::is_none")]
propertyName: Option<Cow<'a, str>>,
#[serde(skip_serializing_if = "Option::is_none")]
pseudoType: Option<crate::dom::PseudoType>,
#[serde(skip_serializing_if = "Option::is_none")]
pseudoIdentifier: Option<Cow<'a, str>>,
}
impl<'a> ResolveValuesParams<'a> {
pub fn builder(values: Vec<Cow<'a, str>>, nodeId: crate::dom::NodeId) -> ResolveValuesParamsBuilder<'a> {
ResolveValuesParamsBuilder {
values: values,
nodeId: nodeId,
propertyName: None,
pseudoType: None,
pseudoIdentifier: None,
}
}
pub fn values(&self) -> &[Cow<'a, str>] { &self.values }
pub fn nodeId(&self) -> &crate::dom::NodeId { &self.nodeId }
pub fn propertyName(&self) -> Option<&str> { self.propertyName.as_deref() }
pub fn pseudoType(&self) -> Option<&crate::dom::PseudoType> { self.pseudoType.as_ref() }
pub fn pseudoIdentifier(&self) -> Option<&str> { self.pseudoIdentifier.as_deref() }
}
pub struct ResolveValuesParamsBuilder<'a> {
values: Vec<Cow<'a, str>>,
nodeId: crate::dom::NodeId,
propertyName: Option<Cow<'a, str>>,
pseudoType: Option<crate::dom::PseudoType>,
pseudoIdentifier: Option<Cow<'a, str>>,
}
impl<'a> ResolveValuesParamsBuilder<'a> {
pub fn propertyName(mut self, propertyName: impl Into<Cow<'a, str>>) -> Self { self.propertyName = Some(propertyName.into()); self }
pub fn pseudoType(mut self, pseudoType: crate::dom::PseudoType) -> Self { self.pseudoType = Some(pseudoType); self }
pub fn pseudoIdentifier(mut self, pseudoIdentifier: impl Into<Cow<'a, str>>) -> Self { self.pseudoIdentifier = Some(pseudoIdentifier.into()); self }
pub fn build(self) -> ResolveValuesParams<'a> {
ResolveValuesParams {
values: self.values,
nodeId: self.nodeId,
propertyName: self.propertyName,
pseudoType: self.pseudoType,
pseudoIdentifier: self.pseudoIdentifier,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ResolveValuesReturns<'a> {
results: Vec<Cow<'a, str>>,
}
impl<'a> ResolveValuesReturns<'a> {
pub fn builder(results: Vec<Cow<'a, str>>) -> ResolveValuesReturnsBuilder<'a> {
ResolveValuesReturnsBuilder {
results: results,
}
}
pub fn results(&self) -> &[Cow<'a, str>] { &self.results }
}
pub struct ResolveValuesReturnsBuilder<'a> {
results: Vec<Cow<'a, str>>,
}
impl<'a> ResolveValuesReturnsBuilder<'a> {
pub fn build(self) -> ResolveValuesReturns<'a> {
ResolveValuesReturns {
results: self.results,
}
}
}
impl<'a> ResolveValuesParams<'a> { pub const METHOD: &'static str = "CSS.resolveValues"; }
impl<'a> crate::CdpCommand<'a> for ResolveValuesParams<'a> {
const METHOD: &'static str = "CSS.resolveValues";
type Response = ResolveValuesReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetLonghandPropertiesParams<'a> {
shorthandName: Cow<'a, str>,
value: Cow<'a, str>,
}
impl<'a> GetLonghandPropertiesParams<'a> {
pub fn builder(shorthandName: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> GetLonghandPropertiesParamsBuilder<'a> {
GetLonghandPropertiesParamsBuilder {
shorthandName: shorthandName.into(),
value: value.into(),
}
}
pub fn shorthandName(&self) -> &str { self.shorthandName.as_ref() }
pub fn value(&self) -> &str { self.value.as_ref() }
}
pub struct GetLonghandPropertiesParamsBuilder<'a> {
shorthandName: Cow<'a, str>,
value: Cow<'a, str>,
}
impl<'a> GetLonghandPropertiesParamsBuilder<'a> {
pub fn build(self) -> GetLonghandPropertiesParams<'a> {
GetLonghandPropertiesParams {
shorthandName: self.shorthandName,
value: self.value,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetLonghandPropertiesReturns<'a> {
longhandProperties: Vec<CSSProperty<'a>>,
}
impl<'a> GetLonghandPropertiesReturns<'a> {
pub fn builder(longhandProperties: Vec<CSSProperty<'a>>) -> GetLonghandPropertiesReturnsBuilder<'a> {
GetLonghandPropertiesReturnsBuilder {
longhandProperties: longhandProperties,
}
}
pub fn longhandProperties(&self) -> &[CSSProperty<'a>] { &self.longhandProperties }
}
pub struct GetLonghandPropertiesReturnsBuilder<'a> {
longhandProperties: Vec<CSSProperty<'a>>,
}
impl<'a> GetLonghandPropertiesReturnsBuilder<'a> {
pub fn build(self) -> GetLonghandPropertiesReturns<'a> {
GetLonghandPropertiesReturns {
longhandProperties: self.longhandProperties,
}
}
}
impl<'a> GetLonghandPropertiesParams<'a> { pub const METHOD: &'static str = "CSS.getLonghandProperties"; }
impl<'a> crate::CdpCommand<'a> for GetLonghandPropertiesParams<'a> {
const METHOD: &'static str = "CSS.getLonghandProperties";
type Response = GetLonghandPropertiesReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetInlineStylesForNodeParams {
nodeId: crate::dom::NodeId,
}
impl GetInlineStylesForNodeParams {
pub fn builder(nodeId: crate::dom::NodeId) -> GetInlineStylesForNodeParamsBuilder {
GetInlineStylesForNodeParamsBuilder {
nodeId: nodeId,
}
}
pub fn nodeId(&self) -> &crate::dom::NodeId { &self.nodeId }
}
pub struct GetInlineStylesForNodeParamsBuilder {
nodeId: crate::dom::NodeId,
}
impl GetInlineStylesForNodeParamsBuilder {
pub fn build(self) -> GetInlineStylesForNodeParams {
GetInlineStylesForNodeParams {
nodeId: self.nodeId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetInlineStylesForNodeReturns<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
inlineStyle: Option<CSSStyle<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
attributesStyle: Option<CSSStyle<'a>>,
}
impl<'a> GetInlineStylesForNodeReturns<'a> {
pub fn builder() -> GetInlineStylesForNodeReturnsBuilder<'a> {
GetInlineStylesForNodeReturnsBuilder {
inlineStyle: None,
attributesStyle: None,
}
}
pub fn inlineStyle(&self) -> Option<&CSSStyle<'a>> { self.inlineStyle.as_ref() }
pub fn attributesStyle(&self) -> Option<&CSSStyle<'a>> { self.attributesStyle.as_ref() }
}
#[derive(Default)]
pub struct GetInlineStylesForNodeReturnsBuilder<'a> {
inlineStyle: Option<CSSStyle<'a>>,
attributesStyle: Option<CSSStyle<'a>>,
}
impl<'a> GetInlineStylesForNodeReturnsBuilder<'a> {
pub fn inlineStyle(mut self, inlineStyle: CSSStyle<'a>) -> Self { self.inlineStyle = Some(inlineStyle); self }
pub fn attributesStyle(mut self, attributesStyle: CSSStyle<'a>) -> Self { self.attributesStyle = Some(attributesStyle); self }
pub fn build(self) -> GetInlineStylesForNodeReturns<'a> {
GetInlineStylesForNodeReturns {
inlineStyle: self.inlineStyle,
attributesStyle: self.attributesStyle,
}
}
}
impl GetInlineStylesForNodeParams { pub const METHOD: &'static str = "CSS.getInlineStylesForNode"; }
impl<'a> crate::CdpCommand<'a> for GetInlineStylesForNodeParams {
const METHOD: &'static str = "CSS.getInlineStylesForNode";
type Response = GetInlineStylesForNodeReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetAnimatedStylesForNodeParams {
nodeId: crate::dom::NodeId,
}
impl GetAnimatedStylesForNodeParams {
pub fn builder(nodeId: crate::dom::NodeId) -> GetAnimatedStylesForNodeParamsBuilder {
GetAnimatedStylesForNodeParamsBuilder {
nodeId: nodeId,
}
}
pub fn nodeId(&self) -> &crate::dom::NodeId { &self.nodeId }
}
pub struct GetAnimatedStylesForNodeParamsBuilder {
nodeId: crate::dom::NodeId,
}
impl GetAnimatedStylesForNodeParamsBuilder {
pub fn build(self) -> GetAnimatedStylesForNodeParams {
GetAnimatedStylesForNodeParams {
nodeId: self.nodeId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetAnimatedStylesForNodeReturns<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
animationStyles: Option<Vec<CSSAnimationStyle<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
transitionsStyle: Option<CSSStyle<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
inherited: Option<Vec<InheritedAnimatedStyleEntry<'a>>>,
}
impl<'a> GetAnimatedStylesForNodeReturns<'a> {
pub fn builder() -> GetAnimatedStylesForNodeReturnsBuilder<'a> {
GetAnimatedStylesForNodeReturnsBuilder {
animationStyles: None,
transitionsStyle: None,
inherited: None,
}
}
pub fn animationStyles(&self) -> Option<&[CSSAnimationStyle<'a>]> { self.animationStyles.as_deref() }
pub fn transitionsStyle(&self) -> Option<&CSSStyle<'a>> { self.transitionsStyle.as_ref() }
pub fn inherited(&self) -> Option<&[InheritedAnimatedStyleEntry<'a>]> { self.inherited.as_deref() }
}
#[derive(Default)]
pub struct GetAnimatedStylesForNodeReturnsBuilder<'a> {
animationStyles: Option<Vec<CSSAnimationStyle<'a>>>,
transitionsStyle: Option<CSSStyle<'a>>,
inherited: Option<Vec<InheritedAnimatedStyleEntry<'a>>>,
}
impl<'a> GetAnimatedStylesForNodeReturnsBuilder<'a> {
pub fn animationStyles(mut self, animationStyles: Vec<CSSAnimationStyle<'a>>) -> Self { self.animationStyles = Some(animationStyles); self }
pub fn transitionsStyle(mut self, transitionsStyle: CSSStyle<'a>) -> Self { self.transitionsStyle = Some(transitionsStyle); self }
pub fn inherited(mut self, inherited: Vec<InheritedAnimatedStyleEntry<'a>>) -> Self { self.inherited = Some(inherited); self }
pub fn build(self) -> GetAnimatedStylesForNodeReturns<'a> {
GetAnimatedStylesForNodeReturns {
animationStyles: self.animationStyles,
transitionsStyle: self.transitionsStyle,
inherited: self.inherited,
}
}
}
impl GetAnimatedStylesForNodeParams { pub const METHOD: &'static str = "CSS.getAnimatedStylesForNode"; }
impl<'a> crate::CdpCommand<'a> for GetAnimatedStylesForNodeParams {
const METHOD: &'static str = "CSS.getAnimatedStylesForNode";
type Response = GetAnimatedStylesForNodeReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetMatchedStylesForNodeParams {
nodeId: crate::dom::NodeId,
}
impl GetMatchedStylesForNodeParams {
pub fn builder(nodeId: crate::dom::NodeId) -> GetMatchedStylesForNodeParamsBuilder {
GetMatchedStylesForNodeParamsBuilder {
nodeId: nodeId,
}
}
pub fn nodeId(&self) -> &crate::dom::NodeId { &self.nodeId }
}
pub struct GetMatchedStylesForNodeParamsBuilder {
nodeId: crate::dom::NodeId,
}
impl GetMatchedStylesForNodeParamsBuilder {
pub fn build(self) -> GetMatchedStylesForNodeParams {
GetMatchedStylesForNodeParams {
nodeId: self.nodeId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetMatchedStylesForNodeReturns<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
inlineStyle: Option<CSSStyle<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
attributesStyle: Option<CSSStyle<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
matchedCSSRules: Option<Vec<RuleMatch<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pseudoElements: Option<Vec<PseudoElementMatches<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
inherited: Option<Vec<InheritedStyleEntry<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
inheritedPseudoElements: Option<Vec<InheritedPseudoElementMatches<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
cssKeyframesRules: Option<Vec<CSSKeyframesRule<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
cssPositionTryRules: Option<Vec<CSSPositionTryRule<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
activePositionFallbackIndex: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
cssPropertyRules: Option<Vec<CSSPropertyRule<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
cssPropertyRegistrations: Option<Vec<CSSPropertyRegistration<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
cssAtRules: Option<Vec<CSSAtRule<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
parentLayoutNodeId: Option<crate::dom::NodeId>,
#[serde(skip_serializing_if = "Option::is_none")]
cssFunctionRules: Option<Vec<CSSFunctionRule<'a>>>,
}
impl<'a> GetMatchedStylesForNodeReturns<'a> {
pub fn builder() -> GetMatchedStylesForNodeReturnsBuilder<'a> {
GetMatchedStylesForNodeReturnsBuilder {
inlineStyle: None,
attributesStyle: None,
matchedCSSRules: None,
pseudoElements: None,
inherited: None,
inheritedPseudoElements: None,
cssKeyframesRules: None,
cssPositionTryRules: None,
activePositionFallbackIndex: None,
cssPropertyRules: None,
cssPropertyRegistrations: None,
cssAtRules: None,
parentLayoutNodeId: None,
cssFunctionRules: None,
}
}
pub fn inlineStyle(&self) -> Option<&CSSStyle<'a>> { self.inlineStyle.as_ref() }
pub fn attributesStyle(&self) -> Option<&CSSStyle<'a>> { self.attributesStyle.as_ref() }
pub fn matchedCSSRules(&self) -> Option<&[RuleMatch<'a>]> { self.matchedCSSRules.as_deref() }
pub fn pseudoElements(&self) -> Option<&[PseudoElementMatches<'a>]> { self.pseudoElements.as_deref() }
pub fn inherited(&self) -> Option<&[InheritedStyleEntry<'a>]> { self.inherited.as_deref() }
pub fn inheritedPseudoElements(&self) -> Option<&[InheritedPseudoElementMatches<'a>]> { self.inheritedPseudoElements.as_deref() }
pub fn cssKeyframesRules(&self) -> Option<&[CSSKeyframesRule<'a>]> { self.cssKeyframesRules.as_deref() }
pub fn cssPositionTryRules(&self) -> Option<&[CSSPositionTryRule<'a>]> { self.cssPositionTryRules.as_deref() }
pub fn activePositionFallbackIndex(&self) -> Option<u64> { self.activePositionFallbackIndex }
pub fn cssPropertyRules(&self) -> Option<&[CSSPropertyRule<'a>]> { self.cssPropertyRules.as_deref() }
pub fn cssPropertyRegistrations(&self) -> Option<&[CSSPropertyRegistration<'a>]> { self.cssPropertyRegistrations.as_deref() }
pub fn cssAtRules(&self) -> Option<&[CSSAtRule<'a>]> { self.cssAtRules.as_deref() }
pub fn parentLayoutNodeId(&self) -> Option<&crate::dom::NodeId> { self.parentLayoutNodeId.as_ref() }
pub fn cssFunctionRules(&self) -> Option<&[CSSFunctionRule<'a>]> { self.cssFunctionRules.as_deref() }
}
#[derive(Default)]
pub struct GetMatchedStylesForNodeReturnsBuilder<'a> {
inlineStyle: Option<CSSStyle<'a>>,
attributesStyle: Option<CSSStyle<'a>>,
matchedCSSRules: Option<Vec<RuleMatch<'a>>>,
pseudoElements: Option<Vec<PseudoElementMatches<'a>>>,
inherited: Option<Vec<InheritedStyleEntry<'a>>>,
inheritedPseudoElements: Option<Vec<InheritedPseudoElementMatches<'a>>>,
cssKeyframesRules: Option<Vec<CSSKeyframesRule<'a>>>,
cssPositionTryRules: Option<Vec<CSSPositionTryRule<'a>>>,
activePositionFallbackIndex: Option<u64>,
cssPropertyRules: Option<Vec<CSSPropertyRule<'a>>>,
cssPropertyRegistrations: Option<Vec<CSSPropertyRegistration<'a>>>,
cssAtRules: Option<Vec<CSSAtRule<'a>>>,
parentLayoutNodeId: Option<crate::dom::NodeId>,
cssFunctionRules: Option<Vec<CSSFunctionRule<'a>>>,
}
impl<'a> GetMatchedStylesForNodeReturnsBuilder<'a> {
pub fn inlineStyle(mut self, inlineStyle: CSSStyle<'a>) -> Self { self.inlineStyle = Some(inlineStyle); self }
pub fn attributesStyle(mut self, attributesStyle: CSSStyle<'a>) -> Self { self.attributesStyle = Some(attributesStyle); self }
pub fn matchedCSSRules(mut self, matchedCSSRules: Vec<RuleMatch<'a>>) -> Self { self.matchedCSSRules = Some(matchedCSSRules); self }
pub fn pseudoElements(mut self, pseudoElements: Vec<PseudoElementMatches<'a>>) -> Self { self.pseudoElements = Some(pseudoElements); self }
pub fn inherited(mut self, inherited: Vec<InheritedStyleEntry<'a>>) -> Self { self.inherited = Some(inherited); self }
pub fn inheritedPseudoElements(mut self, inheritedPseudoElements: Vec<InheritedPseudoElementMatches<'a>>) -> Self { self.inheritedPseudoElements = Some(inheritedPseudoElements); self }
pub fn cssKeyframesRules(mut self, cssKeyframesRules: Vec<CSSKeyframesRule<'a>>) -> Self { self.cssKeyframesRules = Some(cssKeyframesRules); self }
pub fn cssPositionTryRules(mut self, cssPositionTryRules: Vec<CSSPositionTryRule<'a>>) -> Self { self.cssPositionTryRules = Some(cssPositionTryRules); self }
pub fn activePositionFallbackIndex(mut self, activePositionFallbackIndex: u64) -> Self { self.activePositionFallbackIndex = Some(activePositionFallbackIndex); self }
pub fn cssPropertyRules(mut self, cssPropertyRules: Vec<CSSPropertyRule<'a>>) -> Self { self.cssPropertyRules = Some(cssPropertyRules); self }
pub fn cssPropertyRegistrations(mut self, cssPropertyRegistrations: Vec<CSSPropertyRegistration<'a>>) -> Self { self.cssPropertyRegistrations = Some(cssPropertyRegistrations); self }
pub fn cssAtRules(mut self, cssAtRules: Vec<CSSAtRule<'a>>) -> Self { self.cssAtRules = Some(cssAtRules); self }
pub fn parentLayoutNodeId(mut self, parentLayoutNodeId: crate::dom::NodeId) -> Self { self.parentLayoutNodeId = Some(parentLayoutNodeId); self }
pub fn cssFunctionRules(mut self, cssFunctionRules: Vec<CSSFunctionRule<'a>>) -> Self { self.cssFunctionRules = Some(cssFunctionRules); self }
pub fn build(self) -> GetMatchedStylesForNodeReturns<'a> {
GetMatchedStylesForNodeReturns {
inlineStyle: self.inlineStyle,
attributesStyle: self.attributesStyle,
matchedCSSRules: self.matchedCSSRules,
pseudoElements: self.pseudoElements,
inherited: self.inherited,
inheritedPseudoElements: self.inheritedPseudoElements,
cssKeyframesRules: self.cssKeyframesRules,
cssPositionTryRules: self.cssPositionTryRules,
activePositionFallbackIndex: self.activePositionFallbackIndex,
cssPropertyRules: self.cssPropertyRules,
cssPropertyRegistrations: self.cssPropertyRegistrations,
cssAtRules: self.cssAtRules,
parentLayoutNodeId: self.parentLayoutNodeId,
cssFunctionRules: self.cssFunctionRules,
}
}
}
impl GetMatchedStylesForNodeParams { pub const METHOD: &'static str = "CSS.getMatchedStylesForNode"; }
impl<'a> crate::CdpCommand<'a> for GetMatchedStylesForNodeParams {
const METHOD: &'static str = "CSS.getMatchedStylesForNode";
type Response = GetMatchedStylesForNodeReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetEnvironmentVariablesReturns {
environmentVariables: serde_json::Map<String, JsonValue>,
}
impl GetEnvironmentVariablesReturns {
pub fn builder(environmentVariables: serde_json::Map<String, JsonValue>) -> GetEnvironmentVariablesReturnsBuilder {
GetEnvironmentVariablesReturnsBuilder {
environmentVariables: environmentVariables,
}
}
pub fn environmentVariables(&self) -> &serde_json::Map<String, JsonValue> { &self.environmentVariables }
}
pub struct GetEnvironmentVariablesReturnsBuilder {
environmentVariables: serde_json::Map<String, JsonValue>,
}
impl GetEnvironmentVariablesReturnsBuilder {
pub fn build(self) -> GetEnvironmentVariablesReturns {
GetEnvironmentVariablesReturns {
environmentVariables: self.environmentVariables,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct GetEnvironmentVariablesParams {}
impl GetEnvironmentVariablesParams { pub const METHOD: &'static str = "CSS.getEnvironmentVariables"; }
impl<'a> crate::CdpCommand<'a> for GetEnvironmentVariablesParams {
const METHOD: &'static str = "CSS.getEnvironmentVariables";
type Response = GetEnvironmentVariablesReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetMediaQueriesReturns<'a> {
medias: Vec<CSSMedia<'a>>,
}
impl<'a> GetMediaQueriesReturns<'a> {
pub fn builder(medias: Vec<CSSMedia<'a>>) -> GetMediaQueriesReturnsBuilder<'a> {
GetMediaQueriesReturnsBuilder {
medias: medias,
}
}
pub fn medias(&self) -> &[CSSMedia<'a>] { &self.medias }
}
pub struct GetMediaQueriesReturnsBuilder<'a> {
medias: Vec<CSSMedia<'a>>,
}
impl<'a> GetMediaQueriesReturnsBuilder<'a> {
pub fn build(self) -> GetMediaQueriesReturns<'a> {
GetMediaQueriesReturns {
medias: self.medias,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct GetMediaQueriesParams {}
impl GetMediaQueriesParams { pub const METHOD: &'static str = "CSS.getMediaQueries"; }
impl<'a> crate::CdpCommand<'a> for GetMediaQueriesParams {
const METHOD: &'static str = "CSS.getMediaQueries";
type Response = GetMediaQueriesReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetPlatformFontsForNodeParams {
nodeId: crate::dom::NodeId,
}
impl GetPlatformFontsForNodeParams {
pub fn builder(nodeId: crate::dom::NodeId) -> GetPlatformFontsForNodeParamsBuilder {
GetPlatformFontsForNodeParamsBuilder {
nodeId: nodeId,
}
}
pub fn nodeId(&self) -> &crate::dom::NodeId { &self.nodeId }
}
pub struct GetPlatformFontsForNodeParamsBuilder {
nodeId: crate::dom::NodeId,
}
impl GetPlatformFontsForNodeParamsBuilder {
pub fn build(self) -> GetPlatformFontsForNodeParams {
GetPlatformFontsForNodeParams {
nodeId: self.nodeId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetPlatformFontsForNodeReturns<'a> {
fonts: Vec<PlatformFontUsage<'a>>,
}
impl<'a> GetPlatformFontsForNodeReturns<'a> {
pub fn builder(fonts: Vec<PlatformFontUsage<'a>>) -> GetPlatformFontsForNodeReturnsBuilder<'a> {
GetPlatformFontsForNodeReturnsBuilder {
fonts: fonts,
}
}
pub fn fonts(&self) -> &[PlatformFontUsage<'a>] { &self.fonts }
}
pub struct GetPlatformFontsForNodeReturnsBuilder<'a> {
fonts: Vec<PlatformFontUsage<'a>>,
}
impl<'a> GetPlatformFontsForNodeReturnsBuilder<'a> {
pub fn build(self) -> GetPlatformFontsForNodeReturns<'a> {
GetPlatformFontsForNodeReturns {
fonts: self.fonts,
}
}
}
impl GetPlatformFontsForNodeParams { pub const METHOD: &'static str = "CSS.getPlatformFontsForNode"; }
impl<'a> crate::CdpCommand<'a> for GetPlatformFontsForNodeParams {
const METHOD: &'static str = "CSS.getPlatformFontsForNode";
type Response = GetPlatformFontsForNodeReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetStyleSheetTextParams<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
}
impl<'a> GetStyleSheetTextParams<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>) -> GetStyleSheetTextParamsBuilder<'a> {
GetStyleSheetTextParamsBuilder {
styleSheetId: styleSheetId,
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
}
pub struct GetStyleSheetTextParamsBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
}
impl<'a> GetStyleSheetTextParamsBuilder<'a> {
pub fn build(self) -> GetStyleSheetTextParams<'a> {
GetStyleSheetTextParams {
styleSheetId: self.styleSheetId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetStyleSheetTextReturns<'a> {
text: Cow<'a, str>,
}
impl<'a> GetStyleSheetTextReturns<'a> {
pub fn builder(text: impl Into<Cow<'a, str>>) -> GetStyleSheetTextReturnsBuilder<'a> {
GetStyleSheetTextReturnsBuilder {
text: text.into(),
}
}
pub fn text(&self) -> &str { self.text.as_ref() }
}
pub struct GetStyleSheetTextReturnsBuilder<'a> {
text: Cow<'a, str>,
}
impl<'a> GetStyleSheetTextReturnsBuilder<'a> {
pub fn build(self) -> GetStyleSheetTextReturns<'a> {
GetStyleSheetTextReturns {
text: self.text,
}
}
}
impl<'a> GetStyleSheetTextParams<'a> { pub const METHOD: &'static str = "CSS.getStyleSheetText"; }
impl<'a> crate::CdpCommand<'a> for GetStyleSheetTextParams<'a> {
const METHOD: &'static str = "CSS.getStyleSheetText";
type Response = GetStyleSheetTextReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetLayersForNodeParams {
nodeId: crate::dom::NodeId,
}
impl GetLayersForNodeParams {
pub fn builder(nodeId: crate::dom::NodeId) -> GetLayersForNodeParamsBuilder {
GetLayersForNodeParamsBuilder {
nodeId: nodeId,
}
}
pub fn nodeId(&self) -> &crate::dom::NodeId { &self.nodeId }
}
pub struct GetLayersForNodeParamsBuilder {
nodeId: crate::dom::NodeId,
}
impl GetLayersForNodeParamsBuilder {
pub fn build(self) -> GetLayersForNodeParams {
GetLayersForNodeParams {
nodeId: self.nodeId,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetLayersForNodeReturns<'a> {
rootLayer: CSSLayerData<'a>,
}
impl<'a> GetLayersForNodeReturns<'a> {
pub fn builder(rootLayer: CSSLayerData<'a>) -> GetLayersForNodeReturnsBuilder<'a> {
GetLayersForNodeReturnsBuilder {
rootLayer: rootLayer,
}
}
pub fn rootLayer(&self) -> &CSSLayerData<'a> { &self.rootLayer }
}
pub struct GetLayersForNodeReturnsBuilder<'a> {
rootLayer: CSSLayerData<'a>,
}
impl<'a> GetLayersForNodeReturnsBuilder<'a> {
pub fn build(self) -> GetLayersForNodeReturns<'a> {
GetLayersForNodeReturns {
rootLayer: self.rootLayer,
}
}
}
impl GetLayersForNodeParams { pub const METHOD: &'static str = "CSS.getLayersForNode"; }
impl<'a> crate::CdpCommand<'a> for GetLayersForNodeParams {
const METHOD: &'static str = "CSS.getLayersForNode";
type Response = GetLayersForNodeReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetLocationForSelectorParams<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
selectorText: Cow<'a, str>,
}
impl<'a> GetLocationForSelectorParams<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>, selectorText: impl Into<Cow<'a, str>>) -> GetLocationForSelectorParamsBuilder<'a> {
GetLocationForSelectorParamsBuilder {
styleSheetId: styleSheetId,
selectorText: selectorText.into(),
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
pub fn selectorText(&self) -> &str { self.selectorText.as_ref() }
}
pub struct GetLocationForSelectorParamsBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
selectorText: Cow<'a, str>,
}
impl<'a> GetLocationForSelectorParamsBuilder<'a> {
pub fn build(self) -> GetLocationForSelectorParams<'a> {
GetLocationForSelectorParams {
styleSheetId: self.styleSheetId,
selectorText: self.selectorText,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetLocationForSelectorReturns {
ranges: Vec<SourceRange>,
}
impl GetLocationForSelectorReturns {
pub fn builder(ranges: Vec<SourceRange>) -> GetLocationForSelectorReturnsBuilder {
GetLocationForSelectorReturnsBuilder {
ranges: ranges,
}
}
pub fn ranges(&self) -> &[SourceRange] { &self.ranges }
}
pub struct GetLocationForSelectorReturnsBuilder {
ranges: Vec<SourceRange>,
}
impl GetLocationForSelectorReturnsBuilder {
pub fn build(self) -> GetLocationForSelectorReturns {
GetLocationForSelectorReturns {
ranges: self.ranges,
}
}
}
impl<'a> GetLocationForSelectorParams<'a> { pub const METHOD: &'static str = "CSS.getLocationForSelector"; }
impl<'a> crate::CdpCommand<'a> for GetLocationForSelectorParams<'a> {
const METHOD: &'static str = "CSS.getLocationForSelector";
type Response = GetLocationForSelectorReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TrackComputedStyleUpdatesForNodeParams {
#[serde(skip_serializing_if = "Option::is_none")]
nodeId: Option<crate::dom::NodeId>,
}
impl TrackComputedStyleUpdatesForNodeParams {
pub fn builder() -> TrackComputedStyleUpdatesForNodeParamsBuilder {
TrackComputedStyleUpdatesForNodeParamsBuilder {
nodeId: None,
}
}
pub fn nodeId(&self) -> Option<&crate::dom::NodeId> { self.nodeId.as_ref() }
}
#[derive(Default)]
pub struct TrackComputedStyleUpdatesForNodeParamsBuilder {
nodeId: Option<crate::dom::NodeId>,
}
impl TrackComputedStyleUpdatesForNodeParamsBuilder {
pub fn nodeId(mut self, nodeId: crate::dom::NodeId) -> Self { self.nodeId = Some(nodeId); self }
pub fn build(self) -> TrackComputedStyleUpdatesForNodeParams {
TrackComputedStyleUpdatesForNodeParams {
nodeId: self.nodeId,
}
}
}
impl TrackComputedStyleUpdatesForNodeParams { pub const METHOD: &'static str = "CSS.trackComputedStyleUpdatesForNode"; }
impl<'a> crate::CdpCommand<'a> for TrackComputedStyleUpdatesForNodeParams {
const METHOD: &'static str = "CSS.trackComputedStyleUpdatesForNode";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TrackComputedStyleUpdatesParams<'a> {
propertiesToTrack: Vec<CSSComputedStyleProperty<'a>>,
}
impl<'a> TrackComputedStyleUpdatesParams<'a> {
pub fn builder(propertiesToTrack: Vec<CSSComputedStyleProperty<'a>>) -> TrackComputedStyleUpdatesParamsBuilder<'a> {
TrackComputedStyleUpdatesParamsBuilder {
propertiesToTrack: propertiesToTrack,
}
}
pub fn propertiesToTrack(&self) -> &[CSSComputedStyleProperty<'a>] { &self.propertiesToTrack }
}
pub struct TrackComputedStyleUpdatesParamsBuilder<'a> {
propertiesToTrack: Vec<CSSComputedStyleProperty<'a>>,
}
impl<'a> TrackComputedStyleUpdatesParamsBuilder<'a> {
pub fn build(self) -> TrackComputedStyleUpdatesParams<'a> {
TrackComputedStyleUpdatesParams {
propertiesToTrack: self.propertiesToTrack,
}
}
}
impl<'a> TrackComputedStyleUpdatesParams<'a> { pub const METHOD: &'static str = "CSS.trackComputedStyleUpdates"; }
impl<'a> crate::CdpCommand<'a> for TrackComputedStyleUpdatesParams<'a> {
const METHOD: &'static str = "CSS.trackComputedStyleUpdates";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TakeComputedStyleUpdatesReturns {
nodeIds: Vec<crate::dom::NodeId>,
}
impl TakeComputedStyleUpdatesReturns {
pub fn builder(nodeIds: Vec<crate::dom::NodeId>) -> TakeComputedStyleUpdatesReturnsBuilder {
TakeComputedStyleUpdatesReturnsBuilder {
nodeIds: nodeIds,
}
}
pub fn nodeIds(&self) -> &[crate::dom::NodeId] { &self.nodeIds }
}
pub struct TakeComputedStyleUpdatesReturnsBuilder {
nodeIds: Vec<crate::dom::NodeId>,
}
impl TakeComputedStyleUpdatesReturnsBuilder {
pub fn build(self) -> TakeComputedStyleUpdatesReturns {
TakeComputedStyleUpdatesReturns {
nodeIds: self.nodeIds,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct TakeComputedStyleUpdatesParams {}
impl TakeComputedStyleUpdatesParams { pub const METHOD: &'static str = "CSS.takeComputedStyleUpdates"; }
impl<'a> crate::CdpCommand<'a> for TakeComputedStyleUpdatesParams {
const METHOD: &'static str = "CSS.takeComputedStyleUpdates";
type Response = TakeComputedStyleUpdatesReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetEffectivePropertyValueForNodeParams<'a> {
nodeId: crate::dom::NodeId,
propertyName: Cow<'a, str>,
value: Cow<'a, str>,
}
impl<'a> SetEffectivePropertyValueForNodeParams<'a> {
pub fn builder(nodeId: crate::dom::NodeId, propertyName: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> SetEffectivePropertyValueForNodeParamsBuilder<'a> {
SetEffectivePropertyValueForNodeParamsBuilder {
nodeId: nodeId,
propertyName: propertyName.into(),
value: value.into(),
}
}
pub fn nodeId(&self) -> &crate::dom::NodeId { &self.nodeId }
pub fn propertyName(&self) -> &str { self.propertyName.as_ref() }
pub fn value(&self) -> &str { self.value.as_ref() }
}
pub struct SetEffectivePropertyValueForNodeParamsBuilder<'a> {
nodeId: crate::dom::NodeId,
propertyName: Cow<'a, str>,
value: Cow<'a, str>,
}
impl<'a> SetEffectivePropertyValueForNodeParamsBuilder<'a> {
pub fn build(self) -> SetEffectivePropertyValueForNodeParams<'a> {
SetEffectivePropertyValueForNodeParams {
nodeId: self.nodeId,
propertyName: self.propertyName,
value: self.value,
}
}
}
impl<'a> SetEffectivePropertyValueForNodeParams<'a> { pub const METHOD: &'static str = "CSS.setEffectivePropertyValueForNode"; }
impl<'a> crate::CdpCommand<'a> for SetEffectivePropertyValueForNodeParams<'a> {
const METHOD: &'static str = "CSS.setEffectivePropertyValueForNode";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetPropertyRulePropertyNameParams<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
propertyName: Cow<'a, str>,
}
impl<'a> SetPropertyRulePropertyNameParams<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>, range: SourceRange, propertyName: impl Into<Cow<'a, str>>) -> SetPropertyRulePropertyNameParamsBuilder<'a> {
SetPropertyRulePropertyNameParamsBuilder {
styleSheetId: styleSheetId,
range: range,
propertyName: propertyName.into(),
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
pub fn range(&self) -> &SourceRange { &self.range }
pub fn propertyName(&self) -> &str { self.propertyName.as_ref() }
}
pub struct SetPropertyRulePropertyNameParamsBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
propertyName: Cow<'a, str>,
}
impl<'a> SetPropertyRulePropertyNameParamsBuilder<'a> {
pub fn build(self) -> SetPropertyRulePropertyNameParams<'a> {
SetPropertyRulePropertyNameParams {
styleSheetId: self.styleSheetId,
range: self.range,
propertyName: self.propertyName,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetPropertyRulePropertyNameReturns<'a> {
propertyName: ProtocolValue<'a>,
}
impl<'a> SetPropertyRulePropertyNameReturns<'a> {
pub fn builder(propertyName: ProtocolValue<'a>) -> SetPropertyRulePropertyNameReturnsBuilder<'a> {
SetPropertyRulePropertyNameReturnsBuilder {
propertyName: propertyName,
}
}
pub fn propertyName(&self) -> &ProtocolValue<'a> { &self.propertyName }
}
pub struct SetPropertyRulePropertyNameReturnsBuilder<'a> {
propertyName: ProtocolValue<'a>,
}
impl<'a> SetPropertyRulePropertyNameReturnsBuilder<'a> {
pub fn build(self) -> SetPropertyRulePropertyNameReturns<'a> {
SetPropertyRulePropertyNameReturns {
propertyName: self.propertyName,
}
}
}
impl<'a> SetPropertyRulePropertyNameParams<'a> { pub const METHOD: &'static str = "CSS.setPropertyRulePropertyName"; }
impl<'a> crate::CdpCommand<'a> for SetPropertyRulePropertyNameParams<'a> {
const METHOD: &'static str = "CSS.setPropertyRulePropertyName";
type Response = SetPropertyRulePropertyNameReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetKeyframeKeyParams<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
keyText: Cow<'a, str>,
}
impl<'a> SetKeyframeKeyParams<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>, range: SourceRange, keyText: impl Into<Cow<'a, str>>) -> SetKeyframeKeyParamsBuilder<'a> {
SetKeyframeKeyParamsBuilder {
styleSheetId: styleSheetId,
range: range,
keyText: keyText.into(),
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
pub fn range(&self) -> &SourceRange { &self.range }
pub fn keyText(&self) -> &str { self.keyText.as_ref() }
}
pub struct SetKeyframeKeyParamsBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
keyText: Cow<'a, str>,
}
impl<'a> SetKeyframeKeyParamsBuilder<'a> {
pub fn build(self) -> SetKeyframeKeyParams<'a> {
SetKeyframeKeyParams {
styleSheetId: self.styleSheetId,
range: self.range,
keyText: self.keyText,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetKeyframeKeyReturns<'a> {
keyText: ProtocolValue<'a>,
}
impl<'a> SetKeyframeKeyReturns<'a> {
pub fn builder(keyText: ProtocolValue<'a>) -> SetKeyframeKeyReturnsBuilder<'a> {
SetKeyframeKeyReturnsBuilder {
keyText: keyText,
}
}
pub fn keyText(&self) -> &ProtocolValue<'a> { &self.keyText }
}
pub struct SetKeyframeKeyReturnsBuilder<'a> {
keyText: ProtocolValue<'a>,
}
impl<'a> SetKeyframeKeyReturnsBuilder<'a> {
pub fn build(self) -> SetKeyframeKeyReturns<'a> {
SetKeyframeKeyReturns {
keyText: self.keyText,
}
}
}
impl<'a> SetKeyframeKeyParams<'a> { pub const METHOD: &'static str = "CSS.setKeyframeKey"; }
impl<'a> crate::CdpCommand<'a> for SetKeyframeKeyParams<'a> {
const METHOD: &'static str = "CSS.setKeyframeKey";
type Response = SetKeyframeKeyReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetMediaTextParams<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
text: Cow<'a, str>,
}
impl<'a> SetMediaTextParams<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>, range: SourceRange, text: impl Into<Cow<'a, str>>) -> SetMediaTextParamsBuilder<'a> {
SetMediaTextParamsBuilder {
styleSheetId: styleSheetId,
range: range,
text: text.into(),
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
pub fn range(&self) -> &SourceRange { &self.range }
pub fn text(&self) -> &str { self.text.as_ref() }
}
pub struct SetMediaTextParamsBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
text: Cow<'a, str>,
}
impl<'a> SetMediaTextParamsBuilder<'a> {
pub fn build(self) -> SetMediaTextParams<'a> {
SetMediaTextParams {
styleSheetId: self.styleSheetId,
range: self.range,
text: self.text,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetMediaTextReturns<'a> {
media: CSSMedia<'a>,
}
impl<'a> SetMediaTextReturns<'a> {
pub fn builder(media: CSSMedia<'a>) -> SetMediaTextReturnsBuilder<'a> {
SetMediaTextReturnsBuilder {
media: media,
}
}
pub fn media(&self) -> &CSSMedia<'a> { &self.media }
}
pub struct SetMediaTextReturnsBuilder<'a> {
media: CSSMedia<'a>,
}
impl<'a> SetMediaTextReturnsBuilder<'a> {
pub fn build(self) -> SetMediaTextReturns<'a> {
SetMediaTextReturns {
media: self.media,
}
}
}
impl<'a> SetMediaTextParams<'a> { pub const METHOD: &'static str = "CSS.setMediaText"; }
impl<'a> crate::CdpCommand<'a> for SetMediaTextParams<'a> {
const METHOD: &'static str = "CSS.setMediaText";
type Response = SetMediaTextReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetContainerQueryTextParams<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
text: Cow<'a, str>,
}
impl<'a> SetContainerQueryTextParams<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>, range: SourceRange, text: impl Into<Cow<'a, str>>) -> SetContainerQueryTextParamsBuilder<'a> {
SetContainerQueryTextParamsBuilder {
styleSheetId: styleSheetId,
range: range,
text: text.into(),
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
pub fn range(&self) -> &SourceRange { &self.range }
pub fn text(&self) -> &str { self.text.as_ref() }
}
pub struct SetContainerQueryTextParamsBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
text: Cow<'a, str>,
}
impl<'a> SetContainerQueryTextParamsBuilder<'a> {
pub fn build(self) -> SetContainerQueryTextParams<'a> {
SetContainerQueryTextParams {
styleSheetId: self.styleSheetId,
range: self.range,
text: self.text,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetContainerQueryTextReturns<'a> {
containerQuery: CSSContainerQuery<'a>,
}
impl<'a> SetContainerQueryTextReturns<'a> {
pub fn builder(containerQuery: CSSContainerQuery<'a>) -> SetContainerQueryTextReturnsBuilder<'a> {
SetContainerQueryTextReturnsBuilder {
containerQuery: containerQuery,
}
}
pub fn containerQuery(&self) -> &CSSContainerQuery<'a> { &self.containerQuery }
}
pub struct SetContainerQueryTextReturnsBuilder<'a> {
containerQuery: CSSContainerQuery<'a>,
}
impl<'a> SetContainerQueryTextReturnsBuilder<'a> {
pub fn build(self) -> SetContainerQueryTextReturns<'a> {
SetContainerQueryTextReturns {
containerQuery: self.containerQuery,
}
}
}
impl<'a> SetContainerQueryTextParams<'a> { pub const METHOD: &'static str = "CSS.setContainerQueryText"; }
impl<'a> crate::CdpCommand<'a> for SetContainerQueryTextParams<'a> {
const METHOD: &'static str = "CSS.setContainerQueryText";
type Response = SetContainerQueryTextReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetSupportsTextParams<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
text: Cow<'a, str>,
}
impl<'a> SetSupportsTextParams<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>, range: SourceRange, text: impl Into<Cow<'a, str>>) -> SetSupportsTextParamsBuilder<'a> {
SetSupportsTextParamsBuilder {
styleSheetId: styleSheetId,
range: range,
text: text.into(),
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
pub fn range(&self) -> &SourceRange { &self.range }
pub fn text(&self) -> &str { self.text.as_ref() }
}
pub struct SetSupportsTextParamsBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
text: Cow<'a, str>,
}
impl<'a> SetSupportsTextParamsBuilder<'a> {
pub fn build(self) -> SetSupportsTextParams<'a> {
SetSupportsTextParams {
styleSheetId: self.styleSheetId,
range: self.range,
text: self.text,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetSupportsTextReturns<'a> {
supports: CSSSupports<'a>,
}
impl<'a> SetSupportsTextReturns<'a> {
pub fn builder(supports: CSSSupports<'a>) -> SetSupportsTextReturnsBuilder<'a> {
SetSupportsTextReturnsBuilder {
supports: supports,
}
}
pub fn supports(&self) -> &CSSSupports<'a> { &self.supports }
}
pub struct SetSupportsTextReturnsBuilder<'a> {
supports: CSSSupports<'a>,
}
impl<'a> SetSupportsTextReturnsBuilder<'a> {
pub fn build(self) -> SetSupportsTextReturns<'a> {
SetSupportsTextReturns {
supports: self.supports,
}
}
}
impl<'a> SetSupportsTextParams<'a> { pub const METHOD: &'static str = "CSS.setSupportsText"; }
impl<'a> crate::CdpCommand<'a> for SetSupportsTextParams<'a> {
const METHOD: &'static str = "CSS.setSupportsText";
type Response = SetSupportsTextReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetNavigationTextParams<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
text: Cow<'a, str>,
}
impl<'a> SetNavigationTextParams<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>, range: SourceRange, text: impl Into<Cow<'a, str>>) -> SetNavigationTextParamsBuilder<'a> {
SetNavigationTextParamsBuilder {
styleSheetId: styleSheetId,
range: range,
text: text.into(),
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
pub fn range(&self) -> &SourceRange { &self.range }
pub fn text(&self) -> &str { self.text.as_ref() }
}
pub struct SetNavigationTextParamsBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
text: Cow<'a, str>,
}
impl<'a> SetNavigationTextParamsBuilder<'a> {
pub fn build(self) -> SetNavigationTextParams<'a> {
SetNavigationTextParams {
styleSheetId: self.styleSheetId,
range: self.range,
text: self.text,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetNavigationTextReturns<'a> {
navigation: CSSNavigation<'a>,
}
impl<'a> SetNavigationTextReturns<'a> {
pub fn builder(navigation: CSSNavigation<'a>) -> SetNavigationTextReturnsBuilder<'a> {
SetNavigationTextReturnsBuilder {
navigation: navigation,
}
}
pub fn navigation(&self) -> &CSSNavigation<'a> { &self.navigation }
}
pub struct SetNavigationTextReturnsBuilder<'a> {
navigation: CSSNavigation<'a>,
}
impl<'a> SetNavigationTextReturnsBuilder<'a> {
pub fn build(self) -> SetNavigationTextReturns<'a> {
SetNavigationTextReturns {
navigation: self.navigation,
}
}
}
impl<'a> SetNavigationTextParams<'a> { pub const METHOD: &'static str = "CSS.setNavigationText"; }
impl<'a> crate::CdpCommand<'a> for SetNavigationTextParams<'a> {
const METHOD: &'static str = "CSS.setNavigationText";
type Response = SetNavigationTextReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetScopeTextParams<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
text: Cow<'a, str>,
}
impl<'a> SetScopeTextParams<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>, range: SourceRange, text: impl Into<Cow<'a, str>>) -> SetScopeTextParamsBuilder<'a> {
SetScopeTextParamsBuilder {
styleSheetId: styleSheetId,
range: range,
text: text.into(),
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
pub fn range(&self) -> &SourceRange { &self.range }
pub fn text(&self) -> &str { self.text.as_ref() }
}
pub struct SetScopeTextParamsBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
text: Cow<'a, str>,
}
impl<'a> SetScopeTextParamsBuilder<'a> {
pub fn build(self) -> SetScopeTextParams<'a> {
SetScopeTextParams {
styleSheetId: self.styleSheetId,
range: self.range,
text: self.text,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetScopeTextReturns<'a> {
scope: CSSScope<'a>,
}
impl<'a> SetScopeTextReturns<'a> {
pub fn builder(scope: CSSScope<'a>) -> SetScopeTextReturnsBuilder<'a> {
SetScopeTextReturnsBuilder {
scope: scope,
}
}
pub fn scope(&self) -> &CSSScope<'a> { &self.scope }
}
pub struct SetScopeTextReturnsBuilder<'a> {
scope: CSSScope<'a>,
}
impl<'a> SetScopeTextReturnsBuilder<'a> {
pub fn build(self) -> SetScopeTextReturns<'a> {
SetScopeTextReturns {
scope: self.scope,
}
}
}
impl<'a> SetScopeTextParams<'a> { pub const METHOD: &'static str = "CSS.setScopeText"; }
impl<'a> crate::CdpCommand<'a> for SetScopeTextParams<'a> {
const METHOD: &'static str = "CSS.setScopeText";
type Response = SetScopeTextReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetRuleSelectorParams<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
selector: Cow<'a, str>,
}
impl<'a> SetRuleSelectorParams<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>, range: SourceRange, selector: impl Into<Cow<'a, str>>) -> SetRuleSelectorParamsBuilder<'a> {
SetRuleSelectorParamsBuilder {
styleSheetId: styleSheetId,
range: range,
selector: selector.into(),
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
pub fn range(&self) -> &SourceRange { &self.range }
pub fn selector(&self) -> &str { self.selector.as_ref() }
}
pub struct SetRuleSelectorParamsBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
range: SourceRange,
selector: Cow<'a, str>,
}
impl<'a> SetRuleSelectorParamsBuilder<'a> {
pub fn build(self) -> SetRuleSelectorParams<'a> {
SetRuleSelectorParams {
styleSheetId: self.styleSheetId,
range: self.range,
selector: self.selector,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetRuleSelectorReturns<'a> {
selectorList: SelectorList<'a>,
}
impl<'a> SetRuleSelectorReturns<'a> {
pub fn builder(selectorList: SelectorList<'a>) -> SetRuleSelectorReturnsBuilder<'a> {
SetRuleSelectorReturnsBuilder {
selectorList: selectorList,
}
}
pub fn selectorList(&self) -> &SelectorList<'a> { &self.selectorList }
}
pub struct SetRuleSelectorReturnsBuilder<'a> {
selectorList: SelectorList<'a>,
}
impl<'a> SetRuleSelectorReturnsBuilder<'a> {
pub fn build(self) -> SetRuleSelectorReturns<'a> {
SetRuleSelectorReturns {
selectorList: self.selectorList,
}
}
}
impl<'a> SetRuleSelectorParams<'a> { pub const METHOD: &'static str = "CSS.setRuleSelector"; }
impl<'a> crate::CdpCommand<'a> for SetRuleSelectorParams<'a> {
const METHOD: &'static str = "CSS.setRuleSelector";
type Response = SetRuleSelectorReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetStyleSheetTextParams<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
text: Cow<'a, str>,
}
impl<'a> SetStyleSheetTextParams<'a> {
pub fn builder(styleSheetId: crate::dom::StyleSheetId<'a>, text: impl Into<Cow<'a, str>>) -> SetStyleSheetTextParamsBuilder<'a> {
SetStyleSheetTextParamsBuilder {
styleSheetId: styleSheetId,
text: text.into(),
}
}
pub fn styleSheetId(&self) -> &crate::dom::StyleSheetId<'a> { &self.styleSheetId }
pub fn text(&self) -> &str { self.text.as_ref() }
}
pub struct SetStyleSheetTextParamsBuilder<'a> {
styleSheetId: crate::dom::StyleSheetId<'a>,
text: Cow<'a, str>,
}
impl<'a> SetStyleSheetTextParamsBuilder<'a> {
pub fn build(self) -> SetStyleSheetTextParams<'a> {
SetStyleSheetTextParams {
styleSheetId: self.styleSheetId,
text: self.text,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetStyleSheetTextReturns<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
sourceMapURL: Option<Cow<'a, str>>,
}
impl<'a> SetStyleSheetTextReturns<'a> {
pub fn builder() -> SetStyleSheetTextReturnsBuilder<'a> {
SetStyleSheetTextReturnsBuilder {
sourceMapURL: None,
}
}
pub fn sourceMapURL(&self) -> Option<&str> { self.sourceMapURL.as_deref() }
}
#[derive(Default)]
pub struct SetStyleSheetTextReturnsBuilder<'a> {
sourceMapURL: Option<Cow<'a, str>>,
}
impl<'a> SetStyleSheetTextReturnsBuilder<'a> {
pub fn sourceMapURL(mut self, sourceMapURL: impl Into<Cow<'a, str>>) -> Self { self.sourceMapURL = Some(sourceMapURL.into()); self }
pub fn build(self) -> SetStyleSheetTextReturns<'a> {
SetStyleSheetTextReturns {
sourceMapURL: self.sourceMapURL,
}
}
}
impl<'a> SetStyleSheetTextParams<'a> { pub const METHOD: &'static str = "CSS.setStyleSheetText"; }
impl<'a> crate::CdpCommand<'a> for SetStyleSheetTextParams<'a> {
const METHOD: &'static str = "CSS.setStyleSheetText";
type Response = SetStyleSheetTextReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetStyleTextsParams<'a> {
edits: Vec<StyleDeclarationEdit<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
nodeForPropertySyntaxValidation: Option<crate::dom::NodeId>,
}
impl<'a> SetStyleTextsParams<'a> {
pub fn builder(edits: Vec<StyleDeclarationEdit<'a>>) -> SetStyleTextsParamsBuilder<'a> {
SetStyleTextsParamsBuilder {
edits: edits,
nodeForPropertySyntaxValidation: None,
}
}
pub fn edits(&self) -> &[StyleDeclarationEdit<'a>] { &self.edits }
pub fn nodeForPropertySyntaxValidation(&self) -> Option<&crate::dom::NodeId> { self.nodeForPropertySyntaxValidation.as_ref() }
}
pub struct SetStyleTextsParamsBuilder<'a> {
edits: Vec<StyleDeclarationEdit<'a>>,
nodeForPropertySyntaxValidation: Option<crate::dom::NodeId>,
}
impl<'a> SetStyleTextsParamsBuilder<'a> {
pub fn nodeForPropertySyntaxValidation(mut self, nodeForPropertySyntaxValidation: crate::dom::NodeId) -> Self { self.nodeForPropertySyntaxValidation = Some(nodeForPropertySyntaxValidation); self }
pub fn build(self) -> SetStyleTextsParams<'a> {
SetStyleTextsParams {
edits: self.edits,
nodeForPropertySyntaxValidation: self.nodeForPropertySyntaxValidation,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetStyleTextsReturns<'a> {
styles: Vec<CSSStyle<'a>>,
}
impl<'a> SetStyleTextsReturns<'a> {
pub fn builder(styles: Vec<CSSStyle<'a>>) -> SetStyleTextsReturnsBuilder<'a> {
SetStyleTextsReturnsBuilder {
styles: styles,
}
}
pub fn styles(&self) -> &[CSSStyle<'a>] { &self.styles }
}
pub struct SetStyleTextsReturnsBuilder<'a> {
styles: Vec<CSSStyle<'a>>,
}
impl<'a> SetStyleTextsReturnsBuilder<'a> {
pub fn build(self) -> SetStyleTextsReturns<'a> {
SetStyleTextsReturns {
styles: self.styles,
}
}
}
impl<'a> SetStyleTextsParams<'a> { pub const METHOD: &'static str = "CSS.setStyleTexts"; }
impl<'a> crate::CdpCommand<'a> for SetStyleTextsParams<'a> {
const METHOD: &'static str = "CSS.setStyleTexts";
type Response = SetStyleTextsReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct StartRuleUsageTrackingParams {}
impl StartRuleUsageTrackingParams { pub const METHOD: &'static str = "CSS.startRuleUsageTracking"; }
impl<'a> crate::CdpCommand<'a> for StartRuleUsageTrackingParams {
const METHOD: &'static str = "CSS.startRuleUsageTracking";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct StopRuleUsageTrackingReturns<'a> {
ruleUsage: Vec<RuleUsage<'a>>,
}
impl<'a> StopRuleUsageTrackingReturns<'a> {
pub fn builder(ruleUsage: Vec<RuleUsage<'a>>) -> StopRuleUsageTrackingReturnsBuilder<'a> {
StopRuleUsageTrackingReturnsBuilder {
ruleUsage: ruleUsage,
}
}
pub fn ruleUsage(&self) -> &[RuleUsage<'a>] { &self.ruleUsage }
}
pub struct StopRuleUsageTrackingReturnsBuilder<'a> {
ruleUsage: Vec<RuleUsage<'a>>,
}
impl<'a> StopRuleUsageTrackingReturnsBuilder<'a> {
pub fn build(self) -> StopRuleUsageTrackingReturns<'a> {
StopRuleUsageTrackingReturns {
ruleUsage: self.ruleUsage,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct StopRuleUsageTrackingParams {}
impl StopRuleUsageTrackingParams { pub const METHOD: &'static str = "CSS.stopRuleUsageTracking"; }
impl<'a> crate::CdpCommand<'a> for StopRuleUsageTrackingParams {
const METHOD: &'static str = "CSS.stopRuleUsageTracking";
type Response = StopRuleUsageTrackingReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TakeCoverageDeltaReturns<'a> {
coverage: Vec<RuleUsage<'a>>,
timestamp: f64,
}
impl<'a> TakeCoverageDeltaReturns<'a> {
pub fn builder(coverage: Vec<RuleUsage<'a>>, timestamp: f64) -> TakeCoverageDeltaReturnsBuilder<'a> {
TakeCoverageDeltaReturnsBuilder {
coverage: coverage,
timestamp: timestamp,
}
}
pub fn coverage(&self) -> &[RuleUsage<'a>] { &self.coverage }
pub fn timestamp(&self) -> f64 { self.timestamp }
}
pub struct TakeCoverageDeltaReturnsBuilder<'a> {
coverage: Vec<RuleUsage<'a>>,
timestamp: f64,
}
impl<'a> TakeCoverageDeltaReturnsBuilder<'a> {
pub fn build(self) -> TakeCoverageDeltaReturns<'a> {
TakeCoverageDeltaReturns {
coverage: self.coverage,
timestamp: self.timestamp,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct TakeCoverageDeltaParams {}
impl TakeCoverageDeltaParams { pub const METHOD: &'static str = "CSS.takeCoverageDelta"; }
impl<'a> crate::CdpCommand<'a> for TakeCoverageDeltaParams {
const METHOD: &'static str = "CSS.takeCoverageDelta";
type Response = TakeCoverageDeltaReturns<'a>;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetLocalFontsEnabledParams {
enabled: bool,
}
impl SetLocalFontsEnabledParams {
pub fn builder(enabled: bool) -> SetLocalFontsEnabledParamsBuilder {
SetLocalFontsEnabledParamsBuilder {
enabled: enabled,
}
}
pub fn enabled(&self) -> bool { self.enabled }
}
pub struct SetLocalFontsEnabledParamsBuilder {
enabled: bool,
}
impl SetLocalFontsEnabledParamsBuilder {
pub fn build(self) -> SetLocalFontsEnabledParams {
SetLocalFontsEnabledParams {
enabled: self.enabled,
}
}
}
impl SetLocalFontsEnabledParams { pub const METHOD: &'static str = "CSS.setLocalFontsEnabled"; }
impl<'a> crate::CdpCommand<'a> for SetLocalFontsEnabledParams {
const METHOD: &'static str = "CSS.setLocalFontsEnabled";
type Response = crate::EmptyReturns;
}