[][src]Trait savefile::WithSchema

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

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

fn schema(version: u32) -> Schema

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

Loading content...

Implementations on Foreign Types

impl WithSchema for PathBuf[src]

impl WithSchema for String[src]

impl<T: WithSchema> WithSchema for Mutex<T>[src]

impl<T: WithSchema> WithSchema for Mutex<T>[src]

impl<T: WithSchema> WithSchema for RwLock<T>[src]

impl<K: WithSchema + Eq + Hash, V: WithSchema, S: BuildHasher> WithSchema for HashMap<K, V, S>[src]

impl<K: WithSchema + Eq + Hash, V: WithSchema, S: BuildHasher> WithSchema for IndexMap<K, V, S>[src]

impl<K: WithSchema + Eq + Hash, S: BuildHasher> WithSchema for IndexSet<K, S>[src]

impl<T> WithSchema for PhantomData<T>[src]

impl<T: WithSchema> WithSchema for Option<T>[src]

impl WithSchema for BitVec[src]

impl<T: WithSchema> WithSchema for BinaryHeap<T>[src]

impl<T: Array> WithSchema for SmallVec<T> where
    T::Item: WithSchema
[src]

impl<T: WithSchema> WithSchema for Arc<[T]>[src]

impl<T: WithSchema> WithSchema for Vec<T>[src]

impl<T: WithSchema> WithSchema for VecDeque<T>[src]

impl<T: WithSchema, const N: usize> WithSchema for [T; N][src]

impl<T1: WithSchema> WithSchema for Range<T1>[src]

impl<T1: WithSchema, T2: WithSchema, T3: WithSchema> WithSchema for (T1, T2, T3)[src]

impl<T1: WithSchema, T2: WithSchema> WithSchema for (T1, T2)[src]

impl<T1: WithSchema> WithSchema for (T1,)[src]

impl<T: Array<Item = u8> + Copy> WithSchema for ArrayString<T>[src]

impl<V: WithSchema, T: Array<Item = V>> WithSchema for ArrayVec<T>[src]

impl<T: WithSchema> WithSchema for Box<T>[src]

impl<T: WithSchema> WithSchema for Rc<T>[src]

impl<T: WithSchema> WithSchema for Arc<T>[src]

impl<T: WithSchema> WithSchema for RefCell<T>[src]

impl<T: WithSchema> WithSchema for Cell<T>[src]

impl WithSchema for ()[src]

impl WithSchema for AtomicBool[src]

impl WithSchema for AtomicU8[src]

impl WithSchema for AtomicI8[src]

impl WithSchema for AtomicU16[src]

impl WithSchema for AtomicI16[src]

impl WithSchema for AtomicU32[src]

impl WithSchema for AtomicI32[src]

impl WithSchema for AtomicU64[src]

impl WithSchema for AtomicI64[src]

impl WithSchema for AtomicUsize[src]

impl WithSchema for AtomicIsize[src]

impl WithSchema for bool[src]

impl WithSchema for u8[src]

impl WithSchema for i8[src]

impl WithSchema for u16[src]

impl WithSchema for i16[src]

impl WithSchema for u32[src]

impl WithSchema for i32[src]

impl WithSchema for u64[src]

impl WithSchema for i64[src]

impl WithSchema for usize[src]

impl WithSchema for isize[src]

impl WithSchema for f32[src]

impl WithSchema for f64[src]

Loading content...

Implementors

impl WithSchema for Schema[src]

impl WithSchema for SchemaPrimitive[src]

impl WithSchema for Canary1[src]

impl WithSchema for Field[src]

impl WithSchema for SchemaArray[src]

impl WithSchema for SchemaEnum[src]

impl WithSchema for SchemaStruct[src]

impl WithSchema for Variant[src]

impl<T: WithSchema> WithSchema for Removed<T>[src]

Loading content...