Struct swipl::term::ser::SerializerConfiguration
source · pub struct SerializerConfiguration { /* private fields */ }
Expand description
Configuration object for the serializer.
By default, serialization is done with the following options:
- prolog dictionary tags will remain variables.
- struct type names are ignored and will not be set as the dictionary tag.
This object allows you to override these options.
Implementations§
source§impl SerializerConfiguration
impl SerializerConfiguration
sourcepub fn set_default_tag<A: AsAtom>(&mut self, tag: A)
pub fn set_default_tag<A: AsAtom>(&mut self, tag: A)
Set the default tag to use for dictionaries.
This is used when serializing maps. By default, this tag will also be used for structs.
sourcepub fn default_tag<A: AsAtom>(self, tag: A) -> Self
pub fn default_tag<A: AsAtom>(self, tag: A) -> Self
Set the default tag to use for dictionaries.
This is used when serializing maps. By default, this tag will also be used for structs.
sourcepub fn set_tag_struct_dicts(&mut self)
pub fn set_tag_struct_dicts(&mut self)
Ensure that prolog dicts get tagged with the struct name when serializing structs.
If this is not set, instead the default tag is used, or if the default tag is not set, the tag will remain a variable.
sourcepub fn tag_struct_dicts(self) -> Self
pub fn tag_struct_dicts(self) -> Self
Ensure that prolog dicts get tagged with the struct name when serializing structs.
If this is not set, instead the default tag is used, or if the default tag is not set, the tag will remain a variable.
pub fn set_unit_atom(&mut self, unit: Atom)
pub fn unit_atom(self, unit: Atom) -> Self
Trait Implementations§
source§impl Clone for SerializerConfiguration
impl Clone for SerializerConfiguration
source§fn clone(&self) -> SerializerConfiguration
fn clone(&self) -> SerializerConfiguration
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more