Trait savefile::WithSchema[][src]

pub trait WithSchema {
    fn schema(version: u32) -> Schema;
}
Expand description

This trait must be implemented by all data structures you wish to be able to save. It must encode the schema for the datastructure when saved using the given version number. When files are saved, the schema is encoded into the file. when loading, the schema is inspected to make sure that the load will safely succeed. This is only for increased safety, the file format does not in fact use the schema for any other purpose, the design is schema-less at the core, the schema is just an added layer of safety (which can be disabled).

Required methods

Returns a representation of the schema used by this Serialize implementation for the given version.

Implementations on Foreign Types

Implementors