Trait style::dom::TShadowRoot
source · pub trait TShadowRoot: Sized + Copy + Clone + Debug + PartialEq {
type ConcreteNode: TNode<ConcreteShadowRoot = Self>;
// Required methods
fn as_node(&self) -> Self::ConcreteNode;
fn host(&self) -> <Self::ConcreteNode as TNode>::ConcreteElement;
fn style_data<'a>(&self) -> Option<&'a CascadeData>
where Self: 'a;
// Provided methods
fn parts<'a>(&self) -> &[<Self::ConcreteNode as TNode>::ConcreteElement]
where Self: 'a { ... }
fn elements_with_id<'a>(
&self,
_id: &AtomIdent,
) -> Result<&'a [<Self::ConcreteNode as TNode>::ConcreteElement], ()>
where Self: 'a { ... }
fn implicit_scope_for_sheet(
&self,
_sheet_index: usize,
) -> Option<ImplicitScopeRoot> { ... }
}
Expand description
The ShadowRoot trait.
Required Associated Types§
sourcetype ConcreteNode: TNode<ConcreteShadowRoot = Self>
type ConcreteNode: TNode<ConcreteShadowRoot = Self>
The concrete node type.
Required Methods§
sourcefn as_node(&self) -> Self::ConcreteNode
fn as_node(&self) -> Self::ConcreteNode
Get this ShadowRoot as a node.
sourcefn host(&self) -> <Self::ConcreteNode as TNode>::ConcreteElement
fn host(&self) -> <Self::ConcreteNode as TNode>::ConcreteElement
Get the shadow host that hosts this ShadowRoot.
sourcefn style_data<'a>(&self) -> Option<&'a CascadeData>where
Self: 'a,
fn style_data<'a>(&self) -> Option<&'a CascadeData>where
Self: 'a,
Get the style data for this ShadowRoot.
Provided Methods§
sourcefn parts<'a>(&self) -> &[<Self::ConcreteNode as TNode>::ConcreteElement]where
Self: 'a,
fn parts<'a>(&self) -> &[<Self::ConcreteNode as TNode>::ConcreteElement]where
Self: 'a,
Get the list of shadow parts for this shadow root.
sourcefn elements_with_id<'a>(
&self,
_id: &AtomIdent,
) -> Result<&'a [<Self::ConcreteNode as TNode>::ConcreteElement], ()>where
Self: 'a,
fn elements_with_id<'a>(
&self,
_id: &AtomIdent,
) -> Result<&'a [<Self::ConcreteNode as TNode>::ConcreteElement], ()>where
Self: 'a,
Get a list of elements with a given ID in this shadow root, sorted by tree position.
Can return an error to signal that this list is not available, or also return an empty slice.
sourcefn implicit_scope_for_sheet(
&self,
_sheet_index: usize,
) -> Option<ImplicitScopeRoot>
fn implicit_scope_for_sheet( &self, _sheet_index: usize, ) -> Option<ImplicitScopeRoot>
Get the implicit scope for a stylesheet in given index.
Object Safety§
This trait is not object safe.