pub struct SyntaxGenerator;
Expand description
Utility for generating syntax-aware code using the quote crate
Implementations§
Source§impl SyntaxGenerator
impl SyntaxGenerator
Sourcepub fn generate_trait_impl(
&self,
trait_name: &str,
type_name: &str,
methods: HashMap<String, String>,
) -> String
pub fn generate_trait_impl( &self, trait_name: &str, type_name: &str, methods: HashMap<String, String>, ) -> String
Sourcepub fn generate_import(&self, path: &str, items: &[&str]) -> String
pub fn generate_import(&self, path: &str, items: &[&str]) -> String
Sourcepub fn generate_struct(
&self,
struct_name: &str,
fields: HashMap<String, String>,
derive_traits: Option<Vec<&str>>,
) -> String
pub fn generate_struct( &self, struct_name: &str, fields: HashMap<String, String>, derive_traits: Option<Vec<&str>>, ) -> String
Sourcepub fn generate_enum(
&self,
enum_name: &str,
variants: HashMap<String, Option<String>>,
derive_traits: Option<Vec<&str>>,
) -> String
pub fn generate_enum( &self, enum_name: &str, variants: HashMap<String, Option<String>>, derive_traits: Option<Vec<&str>>, ) -> String
Trait Implementations§
Source§impl Debug for SyntaxGenerator
impl Debug for SyntaxGenerator
Source§impl Default for SyntaxGenerator
impl Default for SyntaxGenerator
Source§fn default() -> SyntaxGenerator
fn default() -> SyntaxGenerator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SyntaxGenerator
impl RefUnwindSafe for SyntaxGenerator
impl Send for SyntaxGenerator
impl Sync for SyntaxGenerator
impl Unpin for SyntaxGenerator
impl UnwindSafe for SyntaxGenerator
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