Struct ast_grep_config::RuleConfig
source · pub struct RuleConfig<L: Language> {
pub matcher: RuleWithConstraint<L>,
pub fixer: Option<Pattern<L>>,
/* private fields */
}Fields§
§matcher: RuleWithConstraint<L>§fixer: Option<Pattern<L>>Implementations§
source§impl<L: Language> RuleConfig<L>
impl<L: Language> RuleConfig<L>
pub fn deserialize_str<'de>(yaml_str: &'de str) -> Result<Self, RuleConfigError>where
L: Deserialize<'de>,
pub fn deserialize<'de>(
deserializer: Deserializer<'de>
) -> Result<Self, RuleConfigError>where
L: Deserialize<'de>,
pub fn get_message(&self, node: &NodeMatch<'_, L>) -> String
Methods from Deref<Target = SerializableRuleConfig<L>>§
pub fn get_matcher(&self) -> Result<RuleWithConstraint<L>, RuleConfigError>
pub fn get_fixer(&self) -> Result<Option<Pattern<L>>, RuleConfigError>
Trait Implementations§
source§impl<L: Language> Deref for RuleConfig<L>
impl<L: Language> Deref for RuleConfig<L>
source§impl<L: Language> TryFrom<SerializableRuleConfig<L>> for RuleConfig<L>
impl<L: Language> TryFrom<SerializableRuleConfig<L>> for RuleConfig<L>
§type Error = RuleConfigError
type Error = RuleConfigError
The type returned in the event of a conversion error.