pub struct MatchedNodes { /* private fields */ }Expand description
Container for a set of branch nodes matched to a base node.
In the Java implementation, this uses a HashSet with identity-based
equality. We achieve the same by using node IDs for hashing.
Implementations§
Source§impl MatchedNodes
impl MatchedNodes
Sourcepub fn new(owner: Weak<RefCell<NodeInner>>) -> Self
pub fn new(owner: Weak<RefCell<NodeInner>>) -> Self
Creates a new container for matched nodes.
§Arguments
owner- Weak reference to the base node that owns this container.
Sourcepub fn owner(&self) -> &Weak<RefCell<NodeInner>>
pub fn owner(&self) -> &Weak<RefCell<NodeInner>>
Returns a weak reference to the owner base node.
Sourcepub fn clear_matches(&mut self)
pub fn clear_matches(&mut self)
Clears all matches.
Sourcepub fn match_count(&self) -> usize
pub fn match_count(&self) -> usize
Returns the number of matched nodes.
Sourcepub fn full_match(&self) -> Option<NodeRef>
pub fn full_match(&self) -> Option<NodeRef>
Gets the first node that is fully matched to the owner.
A full match means both content and children match (MATCH_FULL).
Trait Implementations§
Source§impl Clone for MatchedNodes
impl Clone for MatchedNodes
Source§fn clone(&self) -> MatchedNodes
fn clone(&self) -> MatchedNodes
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MatchedNodes
impl Debug for MatchedNodes
Auto Trait Implementations§
impl Freeze for MatchedNodes
impl !RefUnwindSafe for MatchedNodes
impl !Send for MatchedNodes
impl !Sync for MatchedNodes
impl Unpin for MatchedNodes
impl !UnwindSafe for MatchedNodes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more