Struct serde_generate::rust::CodeGenerator
source · [−]pub struct CodeGenerator<'a> { /* private fields */ }Expand description
Main configuration object for code-generation in Rust.
Implementations
sourceimpl<'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> 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more