pub struct CodeGenerator<'a> { /* private fields */ }
Expand description
Main configuration object for code-generation in Rust.
Implementations§
Source§impl<'a> CodeGenerator<'a>
impl<'a> CodeGenerator<'a>
Sourcepub fn new(config: &'a CodeGeneratorConfig) -> Self
pub fn new(config: &'a CodeGeneratorConfig) -> Self
Create a Rust code generator for the given config.
Sourcepub fn with_derive_macros(self, derive_macros: Vec<String>) -> Self
pub fn with_derive_macros(self, derive_macros: Vec<String>) -> Self
Which derive macros should be added (independently from serialization).
Sourcepub fn with_custom_derive_block(
self,
custom_derive_block: Option<String>,
) -> Self
pub fn with_custom_derive_block( self, custom_derive_block: Option<String>, ) -> Self
Additional block of text added after derive_macros
(if any), before each new
container definition.
Sourcepub fn with_track_visibility(self, track_visibility: bool) -> Self
pub fn with_track_visibility(self, track_visibility: bool) -> Self
Whether definitions and fields should be marked as pub
.
Auto Trait Implementations§
impl<'a> Freeze for CodeGenerator<'a>
impl<'a> RefUnwindSafe for CodeGenerator<'a>
impl<'a> Send for CodeGenerator<'a>
impl<'a> Sync for CodeGenerator<'a>
impl<'a> Unpin for CodeGenerator<'a>
impl<'a> UnwindSafe for CodeGenerator<'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