Skip to main content

save_compressed

Function save_compressed 

Source
pub fn save_compressed<T: WithSchema + Serialize>(
    writer: &mut impl Write,
    version: u32,
    data: &T,
) -> Result<(), SavefileError>
Expand description

Write the given data to the writer. Compresses data using ‘bzip2’ compression format.

The current version of data must be version. The resultant data can be loaded using the regular load-function (it autodetects if compressions was active or not). Note, this function will fail if the bzip2-feature is not enabled.