Struct parol::generators::user_trait_generator::UserTraitGenerator
source · pub struct UserTraitGenerator<'a> { /* private fields */ }
Expand description
Generator for user trait code
The lifetime parameter 'a
refers to the lifetime of the contained references.
Implementations§
source§impl<'a> UserTraitGenerator<'a>
impl<'a> UserTraitGenerator<'a>
sourcepub fn new(grammar_config: &'a GrammarConfig) -> Self
pub fn new(grammar_config: &'a GrammarConfig) -> Self
Creates a new instance of the user trait generator
sourcepub fn generate_user_trait_source<C: CommonGeneratorConfig + UserTraitGeneratorConfig>(
&self,
config: &C,
grammar_type: GrammarType,
type_info: &mut GrammarTypeInfo
) -> Result<String>
pub fn generate_user_trait_source<C: CommonGeneratorConfig + UserTraitGeneratorConfig>( &self, config: &C, grammar_type: GrammarType, type_info: &mut GrammarTypeInfo ) -> Result<String>
Generates the file with the user actions trait.
sourcepub fn try_new(grammar_config: &'a GrammarConfig) -> Result<Self>
👎Deprecated since 0.26.0: Please use new
instead
pub fn try_new(grammar_config: &'a GrammarConfig) -> Result<Self>
new
insteadCreates a new item
Trait Implementations§
source§impl<'a> Debug for UserTraitGenerator<'a>
impl<'a> Debug for UserTraitGenerator<'a>
source§impl<'a> Default for UserTraitGenerator<'a>
impl<'a> Default for UserTraitGenerator<'a>
source§fn default() -> UserTraitGenerator<'a>
fn default() -> UserTraitGenerator<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for UserTraitGenerator<'a>
impl<'a> RefUnwindSafe for UserTraitGenerator<'a>
impl<'a> Send for UserTraitGenerator<'a>
impl<'a> Sync for UserTraitGenerator<'a>
impl<'a> Unpin for UserTraitGenerator<'a>
impl<'a> UnwindSafe for UserTraitGenerator<'a>
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