Struct ast_grep_core::NodeMatch 
source · pub struct NodeMatch<'tree, L: Language>(_, _);Implementations
Methods from Deref<Target = Node<'tree, L>>
pub fn is_leaf(&self) -> bool
pub fn kind(&self) -> Cow<'_, str>
pub fn kind_id(&self) -> u16
pub fn is_named(&self) -> bool
pub fn range(&self) -> Range<usize>
pub fn start_pos(&self) -> (usize, usize)
pub fn end_pos(&self) -> (usize, usize)
pub fn text(&self) -> Cow<'r, str>
pub fn to_sexp(&self) -> Cow<'_, str>
pub fn display_context(&self, context_lines: usize) -> DisplayContext<'r>
pub fn lang(&self) -> &L
pub fn matches<M: Matcher<L>>(&self, m: M) -> bool
pub fn inside<M: Matcher<L>>(&self, m: M) -> bool
pub fn has<M: Matcher<L>>(&self, m: M) -> bool
pub fn precedes<M: Matcher<L>>(&self, m: M) -> bool
pub fn follows<M: Matcher<L>>(&self, m: M) -> bool
pub fn children<'s>(&'s self) -> impl ExactSizeIterator<Item = Node<'r, L>> + 's
pub fn dfs<'s>(&'s self) -> Dfs<'r, L>
pub fn find<M: Matcher<L>>(&self, pat: M) -> Option<NodeMatch<'r, L>>
pub fn find_all<M: Matcher<L>>(
    &self,
    pat: M
) -> impl Iterator<Item = NodeMatch<'r, L>>
pub fn field(&self, name: &str) -> Option<Self>
pub fn field_children(&self, name: &str) -> impl Iterator<Item = Node<'r, L>>
pub fn parent(&self) -> Option<Self>
pub fn child(&self, nth: usize) -> Option<Self>
pub fn ancestors(&self) -> impl Iterator<Item = Node<'r, L>> + '_
pub fn next(&self) -> Option<Self>
pub fn next_all(&self) -> impl Iterator<Item = Node<'r, L>> + '_
pub fn prev(&self) -> Option<Node<'r, L>>
pub fn prev_all(&self) -> impl Iterator<Item = Node<'r, L>> + '_
pub fn replace<M: Matcher<L>, R: Replacer<L>>(
    &self,
    matcher: M,
    replacer: R
) -> Option<Edit>
pub fn replace_all<M: Matcher<L>, R: Replacer<L>>(
    &self,
    matcher: M,
    replacer: R
) -> Vec<Edit>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
    A: Allocator,
A: Allocator,
pub fn after(&self)
pub fn before(&self)
pub fn append(&self)
pub fn prepend(&self)
pub fn empty(&self)
pub fn remove(&self)
Trait Implementations
sourceimpl<'tree, L: Language> BorrowMut<Node<'tree, L>> for NodeMatch<'tree, L>
 
impl<'tree, L: Language> BorrowMut<Node<'tree, L>> for NodeMatch<'tree, L>
sourcefn borrow_mut(&mut self) -> &mut Node<'tree, L>
 
fn borrow_mut(&mut self) -> &mut Node<'tree, L>
Mutably borrows from an owned value. Read more
Auto Trait Implementations
impl<'tree, L> RefUnwindSafe for NodeMatch<'tree, L>where
    L: RefUnwindSafe,
impl<'tree, L> !Send for NodeMatch<'tree, L>
impl<'tree, L> !Sync for NodeMatch<'tree, L>
impl<'tree, L> Unpin for NodeMatch<'tree, L>where
    L: Unpin,
impl<'tree, L> UnwindSafe for NodeMatch<'tree, L>where
    L: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more