Expand description
Methods for dumping serializable structs to a compressed binary format, used to allow fast startup times
Currently syntect serializes SyntaxSet
structs with dump_to_uncompressed_file
into .packdump
files and likewise ThemeSet
structs to .themedump
files with dump_to_file
.
You can use these methods to manage your own caching of compiled syntaxes and
themes. And even your own serde::Serialize
structures if you want to
be consistent with your format.
Functionsยง
- dump_
binary - Dumps an object to a binary array in the same format as
dump_to_writer
- dump_
to_ file - Dumps an encodable object to a file at a given path, in the same format as
dump_to_writer
- dump_
to_ uncompressed_ file - To be used when serializing a
SyntaxSet
to a file. ASyntaxSet
itself shall not be compressed, because the data for its lazy-loaded syntaxes are already compressed. Compressing another time just results in bad performance. - dump_
to_ writer - Dumps an object to the given writer in a compressed binary format
- from_
binary - Returns a fully loaded object from a binary dump.
- from_
dump_ file - Returns a fully loaded object from a binary dump file.
- from_
reader - A helper function for decoding and decompressing data from a reader
- from_
uncompressed_ data - To be used when deserializing a
SyntaxSet
from raw data, for example data that has been embedded in your own binary with theinclude_bytes!
macro. - from_
uncompressed_ dump_ file - To be used when deserializing a
SyntaxSet
that was previously written to file using dump_to_uncompressed_file.