Struct kuchiki::NodeDataRef
[−]
[src]
pub struct NodeDataRef<T> { /* fields omitted */ }
Holds a strong reference to a node, but dereferences to some component inside of it.
Methods
impl<T> NodeDataRef<T>
[src]
fn new<F>(rc: NodeRef, f: F) -> NodeDataRef<T> where
F: FnOnce(&Node) -> &T,
F: FnOnce(&Node) -> &T,
Create a NodeDataRef
for a component in a given node.
fn new_opt<F>(rc: NodeRef, f: F) -> Option<NodeDataRef<T>> where
F: FnOnce(&Node) -> Option<&T>,
F: FnOnce(&Node) -> Option<&T>,
Create a NodeDataRef
for and a component that may or may not be in a given node.
fn as_node(&self) -> &NodeRef
Access the corresponding node.
impl NodeDataRef<ElementData>
[src]
fn text_contents(&self) -> String
Return the concatenation of all text nodes in this subtree.
Trait Implementations
impl<T> Deref for NodeDataRef<T>
[src]
type Target = T
The resulting type after dereferencing
fn deref(&self) -> &T
The method called to dereference a value
impl<T: Debug> Debug for NodeDataRef<T>
[src]
impl Element for NodeDataRef<ElementData>
[src]
type Impl = KuchikiSelectors
fn parent_element(&self) -> Option<Self>
fn first_child_element(&self) -> Option<Self>
Skips non-element nodes
fn last_child_element(&self) -> Option<Self>
Skips non-element nodes
fn prev_sibling_element(&self) -> Option<Self>
Skips non-element nodes
fn next_sibling_element(&self) -> Option<Self>
Skips non-element nodes
fn is_empty(&self) -> bool
Returns whether this element matches :empty
. Read more
fn is_root(&self) -> bool
Returns whether this element matches :root
, i.e. whether it is the root element of a document. Read more
fn is_html_element_in_html_document(&self) -> bool
fn get_local_name<'a>(&'a self) -> &'a LocalName
fn get_namespace<'a>(&'a self) -> &'a Namespace
Empty string for no namespace
fn get_id(&self) -> Option<LocalName>
fn has_class(&self, name: &LocalName) -> bool
fn attr_matches(
&self,
ns: &NamespaceConstraint<&Namespace>,
local_name: &LocalName,
operation: &AttrSelectorOperation<&String>
) -> bool
&self,
ns: &NamespaceConstraint<&Namespace>,
local_name: &LocalName,
operation: &AttrSelectorOperation<&String>
) -> bool
fn match_pseudo_element(
&self,
pseudo: &PseudoElement,
_context: &mut MatchingContext
) -> bool
&self,
pseudo: &PseudoElement,
_context: &mut MatchingContext
) -> bool
fn match_non_ts_pseudo_class<F>(
&self,
pseudo: &PseudoClass,
_context: &mut MatchingContext,
_flags_setter: &mut F
) -> bool where
F: FnMut(&Self, ElementSelectorFlags),
&self,
pseudo: &PseudoClass,
_context: &mut MatchingContext,
_flags_setter: &mut F
) -> bool where
F: FnMut(&Self, ElementSelectorFlags),
fn pseudo_element_originating_element(&self) -> Option<Self>
The parent of a given pseudo-element, after matching a pseudo-element selector. Read more