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 type_script_types(self, enabled: bool) -> Self
pub fn type_script_types(self, enabled: bool) -> Self
Enabling or disabling of typescript types code generation.
When enabling this, runtime type checks could be disabled with [‘GenerationSettings::runtime_type_checks()’] because the static type checks should enforce correct types. Additionally serialization should be faster without runtime type checks.
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.