pub trait StyleNode {
type Class: StyleNodeClass;
type ClassIter<'a>: Iterator<Item = &'a Self::Class>
where Self: 'a;
// Required methods
fn style_scope(&self) -> Option<NonZeroUsize>;
fn extra_style_scope(&self) -> Option<NonZeroUsize>;
fn host_style_scope(&self) -> Option<NonZeroUsize>;
fn tag_name(&self) -> &str;
fn id(&self) -> Option<&str>;
fn classes(&self) -> Self::ClassIter<'_>;
fn attribute(
&self,
name: &str,
) -> Option<(&str, StyleNodeAttributeCaseSensitivity)>;
fn pseudo_element(&self) -> Option<PseudoElements>;
// Provided method
fn contain_scope(&self, scope: Option<NonZeroUsize>) -> bool { ... }
}
Expand description
A node descriptor for a style query.
Required Associated Types§
Sourcetype Class: StyleNodeClass
type Class: StyleNodeClass
The type for a class.
Required Methods§
Sourcefn style_scope(&self) -> Option<NonZeroUsize>
fn style_scope(&self) -> Option<NonZeroUsize>
The style scope of the node itself.
Sourcefn extra_style_scope(&self) -> Option<NonZeroUsize>
fn extra_style_scope(&self) -> Option<NonZeroUsize>
The extra style scope of the node.
Sourcefn host_style_scope(&self) -> Option<NonZeroUsize>
fn host_style_scope(&self) -> Option<NonZeroUsize>
The extra style scope for the :host
selector.
Sourcefn attribute(
&self,
name: &str,
) -> Option<(&str, StyleNodeAttributeCaseSensitivity)>
fn attribute( &self, name: &str, ) -> Option<(&str, StyleNodeAttributeCaseSensitivity)>
Get an attribute of the node.
Sourcefn pseudo_element(&self) -> Option<PseudoElements>
fn pseudo_element(&self) -> Option<PseudoElements>
The pseudo element to query.
Provided Methods§
Sourcefn contain_scope(&self, scope: Option<NonZeroUsize>) -> bool
fn contain_scope(&self, scope: Option<NonZeroUsize>) -> bool
Check if the node has a specified scope.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.