pub struct GenerationSettings { /* private fields */ }Expand description
Settings for bindings generation.
This enables the possibility to enable or disable serialization, deserialization, runtime type checks or type script types. Less code will be generated if an option is off.
By default, only deserialization is enabled. Serialization can be enabled by using GenerationSettings::serialization().
Deserialization can be disabled with GenerationSettings::deserialization().
To enable all at once use GenerationSettings::enable_all().
Implementations§
Source§impl GenerationSettings
impl GenerationSettings
Sourcepub fn enable_all() -> Self
pub fn enable_all() -> Self
Constructs GenerationSettings and enables all options at once.
Sourcepub fn serialization(self, enabled: bool) -> Self
pub fn serialization(self, enabled: bool) -> Self
Enabling or disabling of serialization code generation.
Sourcepub fn deserialization(self, enabled: bool) -> Self
pub fn deserialization(self, enabled: bool) -> Self
Enabling or disabling of deserialization code generation.
Sourcepub fn runtime_type_checks(self, enabled: bool) -> Self
pub fn runtime_type_checks(self, enabled: bool) -> Self
Enabling or disabling of runtime type checks code generation.
Disabling this should lead to a speed increase at serialization.
Sourcepub fn module_structure(self, enabled: bool) -> Self
pub fn module_structure(self, enabled: bool) -> Self
Enabling or disabling of module structure code generation.
Enabling this will generate the types in the same module structure as in rust. Root level types will be in the root of the generated module (subpackage types). Types nested in modules will be in subpackages (e.g. types.<mod_name>.<type_name>). This avoids name clashes.
Disabling this will generate all types in the root module.