pub struct CodeGeneratorConfig {
pub module_name: String,
pub serialization: bool,
pub encodings: BTreeSet<Encoding>,
pub external_definitions: ExternalDefinitions,
pub comments: DocComments,
pub custom_code: CustomCode,
pub enums: EnumConfig,
pub package_manifest: bool,
}Expand description
Code generation options meant to be supported by all languages.
Fields§
§module_name: String§serialization: bool§encodings: BTreeSet<Encoding>§external_definitions: ExternalDefinitions§comments: DocComments§custom_code: CustomCode§enums: EnumConfig§package_manifest: boolImplementations§
Source§impl CodeGeneratorConfig
impl CodeGeneratorConfig
pub fn module_name(&self) -> &str
Sourcepub fn with_serialization(self, serialization: bool) -> Self
pub fn with_serialization(self, serialization: bool) -> Self
Whether to include serialization methods.
Sourcepub fn with_encodings<I>(self, encodings: I) -> Selfwhere
I: IntoIterator<Item = Encoding>,
pub fn with_encodings<I>(self, encodings: I) -> Selfwhere
I: IntoIterator<Item = Encoding>,
Whether to include specialized methods for specific encodings.
Sourcepub fn with_external_definitions(
self,
external_definitions: ExternalDefinitions,
) -> Self
pub fn with_external_definitions( self, external_definitions: ExternalDefinitions, ) -> Self
Container names provided by external modules.
Sourcepub fn with_comments(self, comments: DocComments) -> Self
pub fn with_comments(self, comments: DocComments) -> Self
Comments attached to particular entity.
Sourcepub fn with_custom_code(self, code: CustomCode) -> Self
pub fn with_custom_code(self, code: CustomCode) -> Self
Custom code attached to particular entity.
Sourcepub fn with_c_style_enums(self, c_style_enums: bool) -> Self
pub fn with_c_style_enums(self, c_style_enums: bool) -> Self
Generate C-style enums (without variant data) as the target language native enum type in supported languages.
Sourcepub fn with_sealed_enums(self, sealed: bool) -> Self
pub fn with_sealed_enums(self, sealed: bool) -> Self
For complex enums generate sealed enum classes instead of abstract classes
Sourcepub fn with_enum_type_overrides(
self,
overrides: HashMap<&'static str, &'static str>,
) -> Self
pub fn with_enum_type_overrides( self, overrides: HashMap<&'static str, &'static str>, ) -> Self
Generate abstract or sealed classes for data enums based on with_sealed_enums
but allow item by item overrides.
Sourcepub fn with_package_manifest(self, package_manifest: bool) -> Self
pub fn with_package_manifest(self, package_manifest: bool) -> Self
Generate a package manifest file for the target language.
Trait Implementations§
Source§impl Clone for CodeGeneratorConfig
impl Clone for CodeGeneratorConfig
Source§fn clone(&self) -> CodeGeneratorConfig
fn clone(&self) -> CodeGeneratorConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CodeGeneratorConfig
impl RefUnwindSafe for CodeGeneratorConfig
impl Send for CodeGeneratorConfig
impl Sync for CodeGeneratorConfig
impl Unpin for CodeGeneratorConfig
impl UnsafeUnpin for CodeGeneratorConfig
impl UnwindSafe for CodeGeneratorConfig
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