Struct ast_grep_config::RuleCollection
source · pub struct RuleCollection<L: Language + Eq> { /* private fields */ }Expand description
A collection of rules to run one round of scanning. Rules will be grouped together based on their language, path globbing and pattern rule.
Implementations§
source§impl<L: Language + Eq> RuleCollection<L>
impl<L: Language + Eq> RuleCollection<L>
pub fn try_new(configs: Vec<RuleConfig<L>>) -> Result<Self, Error>
pub fn get_rule_from_lang(&self, path: &Path, lang: L) -> Vec<&RuleConfig<L>>
pub fn for_path<P: AsRef<Path>>(&self, path: P) -> Vec<&RuleConfig<L>>
pub fn get_rule(&self, id: &str) -> Option<&RuleConfig<L>>
Trait Implementations§
Auto Trait Implementations§
impl<L> Freeze for RuleCollection<L>
impl<L> RefUnwindSafe for RuleCollection<L>where
L: RefUnwindSafe,
impl<L> Send for RuleCollection<L>
impl<L> Sync for RuleCollection<L>
impl<L> Unpin for RuleCollection<L>where
L: Unpin,
impl<L> UnwindSafe for RuleCollection<L>where
L: UnwindSafe,
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