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]
pub fn new<F>(rc: NodeRef, f: F) -> NodeDataRef<T> where
F: FnOnce(&Node) -> &T,
[src]
F: FnOnce(&Node) -> &T,
Create a NodeDataRef
for a component in a given node.
pub fn new_opt<F>(rc: NodeRef, f: F) -> Option<NodeDataRef<T>> where
F: FnOnce(&Node) -> Option<&T>,
[src]
F: FnOnce(&Node) -> Option<&T>,
Create a NodeDataRef
for and a component that may or may not be in a given node.
pub fn as_node(&self) -> &NodeRef
[src]
Access the corresponding node.
impl NodeDataRef<ElementData>
[src]
pub fn text_contents(&self) -> String
[src]
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.
ⓘImportant traits for &'a mut Wfn deref(&self) -> &T
[src]
Dereferences the value.
impl<T> Clone for NodeDataRef<T>
[src]
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Debug> Debug for NodeDataRef<T>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl Element for NodeDataRef<ElementData>
[src]
type Impl = KuchikiSelectors
fn opaque(&self) -> OpaqueElement
[src]
Converts self into an opaque representation.
fn parent_element(&self) -> Option<Self>
[src]
fn first_child_element(&self) -> Option<Self>
[src]
Skips non-element nodes
fn last_child_element(&self) -> Option<Self>
[src]
Skips non-element nodes
fn prev_sibling_element(&self) -> Option<Self>
[src]
Skips non-element nodes
fn next_sibling_element(&self) -> Option<Self>
[src]
Skips non-element nodes
fn is_empty(&self) -> bool
[src]
Returns whether this element matches :empty
. Read more
fn is_root(&self) -> bool
[src]
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
[src]
fn get_local_name<'a>(&'a self) -> &'a LocalName
[src]
fn get_namespace<'a>(&'a self) -> &'a Namespace
[src]
Empty string for no namespace
fn is_link(&self) -> bool
[src]
Whether this element is a link
.
fn has_id(&self, id: &LocalName, case_sensitivity: CaseSensitivity) -> bool
[src]
fn has_class(&self, name: &LocalName, case_sensitivity: CaseSensitivity) -> bool
[src]
fn attr_matches(
&self,
ns: &NamespaceConstraint<&Namespace>,
local_name: &LocalName,
operation: &AttrSelectorOperation<&String>
) -> bool
[src]
&self,
ns: &NamespaceConstraint<&Namespace>,
local_name: &LocalName,
operation: &AttrSelectorOperation<&String>
) -> bool
fn match_pseudo_element(
&self,
pseudo: &PseudoElement,
_context: &mut MatchingContext<KuchikiSelectors>
) -> bool
[src]
&self,
pseudo: &PseudoElement,
_context: &mut MatchingContext<KuchikiSelectors>
) -> bool
fn match_non_ts_pseudo_class<F>(
&self,
pseudo: &PseudoClass,
_context: &mut MatchingContext<KuchikiSelectors>,
_visited_handling: VisitedHandlingMode,
_flags_setter: &mut F
) -> bool where
F: FnMut(&Self, ElementSelectorFlags),
[src]
&self,
pseudo: &PseudoClass,
_context: &mut MatchingContext<KuchikiSelectors>,
_visited_handling: VisitedHandlingMode,
_flags_setter: &mut F
) -> bool where
F: FnMut(&Self, ElementSelectorFlags),
fn pseudo_element_originating_element(&self) -> Option<Self>
[src]
The parent of a given pseudo-element, after matching a pseudo-element selector. Read more
fn assigned_slot(&self) -> Option<Self>
[src]
Returns the assigned element this element is assigned to. Read more
fn ignores_nth_child_selectors(&self) -> bool
[src]
Returns whether this element should ignore matching nth child selector. Read more
fn blocks_ancestor_combinators(&self) -> bool
[src]
Return true if we want to stop lookup ancestor of the current element while matching complex selectors with descendant/child combinator. Read more