pub struct MatchArea { /* private fields */ }Expand description
Tags nodes in the same matched subtree.
This is used during the matching phase to track which nodes belong to a matched region and their combined information size.
Implementations§
Source§impl MatchArea
impl MatchArea
Sourcepub fn new(root: WeakNodeRef) -> Self
pub fn new(root: WeakNodeRef) -> Self
Creates a new match area with the given root node.
Sourcepub fn root(&self) -> &WeakNodeRef
pub fn root(&self) -> &WeakNodeRef
Returns a reference to the root node weak reference.
Sourcepub fn root_strong(&self) -> Option<NodeRef>
pub fn root_strong(&self) -> Option<NodeRef>
Returns the root as a strong reference if it still exists.
Sourcepub fn add_info_bytes(&self, bytes: i32)
pub fn add_info_bytes(&self, bytes: i32)
Adds to the accumulated information bytes.
Sourcepub fn info_bytes(&self) -> i32
pub fn info_bytes(&self) -> i32
Returns the accumulated information bytes.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MatchArea
impl !RefUnwindSafe for MatchArea
impl !Send for MatchArea
impl !Sync for MatchArea
impl Unpin for MatchArea
impl !UnwindSafe for MatchArea
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