Struct ast_grep_config::CombinedScan
source · pub struct CombinedScan<'r, L: Language> { /* private fields */ }Expand description
A struct to group all rules according to their potential kinds. This can greatly reduce traversal times and skip unmatchable rules. Rules are referenced by their index in the rules vector.
Implementations§
source§impl<'r, L: Language> CombinedScan<'r, L>
impl<'r, L: Language> CombinedScan<'r, L>
pub fn new(rules: Vec<&'r RuleConfig<L>>) -> Self
pub fn find<D>(&self, root: &AstGrep<D>) -> PreScanwhere
D: Doc<Lang = L>,
pub fn scan<'a, D>(
&self,
root: &'a AstGrep<D>,
pre: PreScan,
separate_fix: bool,
) -> ScanResult<'a, D>where
D: Doc<Lang = L>,
pub fn get_rule(&self, idx: usize) -> &RuleConfig<L>
Auto Trait Implementations§
impl<'r, L> Freeze for CombinedScan<'r, L>
impl<'r, L> RefUnwindSafe for CombinedScan<'r, L>where
L: RefUnwindSafe,
impl<'r, L> Send for CombinedScan<'r, L>
impl<'r, L> Sync for CombinedScan<'r, L>
impl<'r, L> Unpin for CombinedScan<'r, L>
impl<'r, L> UnwindSafe for CombinedScan<'r, L>where
L: RefUnwindSafe,
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