Struct ast_grep_config::RuleConfig
source · pub struct RuleConfig<L: Language> {
pub matcher: RuleWithConstraint<L>,
pub fixer: Option<TemplateFix<String>>,
/* private fields */
}Fields§
§matcher: RuleWithConstraint<L>§fixer: Option<TemplateFix<String>>Implementations§
source§impl<L: Language> RuleConfig<L>
impl<L: Language> RuleConfig<L>
pub fn try_from( inner: SerializableRuleConfig<L>, globals: &GlobalRules<L> ) -> Result<Self, RuleConfigError>
pub fn deserialize<'de>(
deserializer: Deserializer<'de>,
globals: &GlobalRules<L>
) -> Result<Self, RuleConfigError>where
L: Deserialize<'de>,
pub fn get_message(&self, node: &NodeMatch<'_, StrDoc<L>>) -> String
Methods from Deref<Target = SerializableRuleConfig<L>>§
pub fn get_fixer<C: IndentSensitive>( &self ) -> Result<Option<TemplateFix<C>>, RuleConfigError>
Methods from Deref<Target = SerializableRuleCore<L>>§
pub fn get_matcher( &self, globals: &GlobalRules<L> ) -> Result<RuleWithConstraint<L>, RuleConfigError>
Trait Implementations§
Auto Trait Implementations§
impl<L> RefUnwindSafe for RuleConfig<L>where
L: RefUnwindSafe,
impl<L> Send for RuleConfig<L>
impl<L> Sync for RuleConfig<L>
impl<L> Unpin for RuleConfig<L>where
L: Unpin,
impl<L> UnwindSafe for RuleConfig<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