pub struct DeduplicatedString(pub String);Expand description
Wrapper for strings, enabling desert’s string deduplication mode.
The library have a simple deduplication system, without sacrificing any extra
bytes for cases when strings are not duplicate. In general, the strings are encoded by a variable length
int representing the length of the string in bytes, followed by its UTF-8 encoding.
When deduplication is enabled (the string values are wrapped in DeduplicatedString) , each serialized
string gets an ID and if it is serialized once more in the same stream, a negative number in place of the
length identifies it.
It is not turned on by default because it breaks backward compatibility when evolving data structures. If a new string field is added, old versions of the application will skip it and would not assign the same ID to the string if it is first seen.
Tuple Fields§
§0: String