pub struct Config {
pub compatible: bool,
pub xlang: bool,
pub share_meta: bool,
pub compress_string: bool,
pub check_string_read: bool,
pub max_dyn_depth: u32,
pub check_struct_version: bool,
pub track_ref: bool,
pub max_type_fields: u32,
pub max_type_meta_bytes: u32,
pub max_schema_versions_per_type: u32,
pub max_average_schema_versions_per_type: u32,
}Expand description
Configuration for Fory serialization.
This struct holds all the configuration options that control how Fory
serializes and deserializes data. It is shared between the main Fory
instance and the WriteContext/ReadContext to ensure consistent behavior.
Fields§
§compatible: boolWhether compatible mode is enabled for schema evolution support.
xlang: boolWhether xlang mode is enabled.
Whether metadata sharing is enabled.
compress_string: boolWhether meta string compression is enabled.
check_string_read: boolWhether UTF-8 string payloads are validated before constructing Rust strings.
max_dyn_depth: u32Maximum depth for nested dynamic object serialization.
check_struct_version: boolWhether class version checking is enabled.
track_ref: boolWhether reference tracking is enabled. When enabled, shared references and circular references are tracked and preserved during serialization/deserialization.
max_type_fields: u32Maximum accepted field count in one received struct TypeMeta.
max_type_meta_bytes: u32Maximum accepted body size in one received TypeMeta.
max_schema_versions_per_type: u32Maximum accepted remote metadata versions for one logical type.
max_average_schema_versions_per_type: u32Maximum accepted average remote metadata versions across logical types.
Implementations§
Source§impl Config
impl Config
Sourcepub fn is_compatible(&self) -> bool
pub fn is_compatible(&self) -> bool
Check if compatible mode is enabled.
Check if meta sharing is enabled.
Sourcepub fn is_compress_string(&self) -> bool
pub fn is_compress_string(&self) -> bool
Check if string compression is enabled.
Sourcepub fn is_check_string_read(&self) -> bool
pub fn is_check_string_read(&self) -> bool
Check if UTF-8 string payload validation is enabled.
Sourcepub fn max_dyn_depth(&self) -> u32
pub fn max_dyn_depth(&self) -> u32
Get maximum dynamic depth.
Sourcepub fn is_check_struct_version(&self) -> bool
pub fn is_check_struct_version(&self) -> bool
Check if class version checking is enabled.
Sourcepub fn is_track_ref(&self) -> bool
pub fn is_track_ref(&self) -> bool
Check if reference tracking is enabled.
Sourcepub fn max_type_fields(&self) -> usize
pub fn max_type_fields(&self) -> usize
Get maximum accepted field count in one received struct TypeMeta.
Sourcepub fn max_type_meta_bytes(&self) -> usize
pub fn max_type_meta_bytes(&self) -> usize
Get maximum accepted body size in one received TypeMeta.
Sourcepub fn max_schema_versions_per_type(&self) -> usize
pub fn max_schema_versions_per_type(&self) -> usize
Get maximum accepted remote metadata versions for one logical type.
Sourcepub fn max_average_schema_versions_per_type(&self) -> usize
pub fn max_average_schema_versions_per_type(&self) -> usize
Get maximum accepted average remote metadata versions across logical types.