Module syntect::dumps [] [src]

Methods for dumping serializable structs to a compressed binary format These are used to load and store the dumps used for fast startup times.

Currently syntect serializes SyntaxSet structs with dump_to_file into .packdump files and likewise ThemeSet structs to .themedump files.

You can use these methods to manage your own caching of compiled syntaxes and themes. And even your own rustc_serialize::Encodable 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_file

dump_to_file

Dumps an encodable object to a file at a given path. If a file already exists at that path it will be overwritten. The files created are encoded with the bincode crate and then compressed with the flate2 crate.

from_binary

Returns a fully loaded and linked syntax set from a binary dump. Panics if the dump is invalid.

from_dump_file

Returns a fully loaded and linked syntax set from a binary dump file.