pub struct PatternMatch {
pub byte_start: usize,
pub byte_end: usize,
pub text: String,
pub captures: HashMap<String, String>,
}Expand description
A match from an ast-grep pattern with captured metavariables.
Fields§
§byte_start: usizeByte range of the entire match
byte_end: usize§text: StringThe matched text
captures: HashMap<String, String>Captured metavariables: name -> text Note: For byte spans of captures, use find_capture_span()
Implementations§
Source§impl PatternMatch
impl PatternMatch
Trait Implementations§
Source§impl Clone for PatternMatch
impl Clone for PatternMatch
Source§fn clone(&self) -> PatternMatch
fn clone(&self) -> PatternMatch
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 moreAuto Trait Implementations§
impl Freeze for PatternMatch
impl RefUnwindSafe for PatternMatch
impl Send for PatternMatch
impl Sync for PatternMatch
impl Unpin for PatternMatch
impl UnsafeUnpin for PatternMatch
impl UnwindSafe for PatternMatch
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