Struct ast_grep_config::DeserializeEnv
source · pub struct DeserializeEnv<L: Language> { /* private fields */ }Expand description
A struct to store information to deserialize rules.
Implementations§
source§impl<L: Language> DeserializeEnv<L>
impl<L: Language> DeserializeEnv<L>
pub fn new(lang: L) -> Self
sourcepub fn register_local_utils(
self,
utils: &HashMap<String, SerializableRule>
) -> Result<Self, RuleSerializeError>
pub fn register_local_utils( self, utils: &HashMap<String, SerializableRule> ) -> Result<Self, RuleSerializeError>
register utils rule in the DeserializeEnv for later usage.
N.B. This function will manage the util registration order
by their dependency. potential_kinds need ordered insertion.
sourcepub fn parse_global_utils(
utils: Vec<SerializableGlobalRule<L>>
) -> Result<GlobalRules<L>, RuleCoreError>
pub fn parse_global_utils( utils: Vec<SerializableGlobalRule<L>> ) -> Result<GlobalRules<L>, RuleCoreError>
register global utils rule discovered in the config.
pub fn deserialize_rule( &self, serialized: SerializableRule ) -> Result<Rule<L>, RuleSerializeError>
pub fn with_globals(self, globals: &GlobalRules<L>) -> Self
pub fn with_rewriters(self, globals: &GlobalRules<L>) -> Self
Auto Trait Implementations§
impl<L> Freeze for DeserializeEnv<L>where
L: Freeze,
impl<L> RefUnwindSafe for DeserializeEnv<L>where
L: RefUnwindSafe,
impl<L> Send for DeserializeEnv<L>
impl<L> Sync for DeserializeEnv<L>
impl<L> Unpin for DeserializeEnv<L>where
L: Unpin,
impl<L> UnwindSafe for DeserializeEnv<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