Storable

Trait Storable 

Source
pub trait Storable:
    Serialize
    + for<'lt> Deserialize<'lt>
    + Clone
    + Debug
    + Ord
    + PartialEq {
    // Required method
    fn type_description() -> String;
}
Expand description

Marks the traits as storable in XvcStore

It requires to implement an fn to describe the store names. It also requires the implementer to be (serde) serializable, and to implement Clone, Debug, Ord and PartialEq.

These are to use JSON as storage format, and to be able to use BTreeMaps as data structures.

Required Methods§

Source

fn type_description() -> String

A string representation for the type.

By convention this should be in kebab-case, like xvc-path for [xvc-core::XvcPath]. Xvc uses this to create filenames in serialization.

See crate::persist macro to specify this representation conveniently.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Storable for i32

Source§

impl Storable for usize

Source§

impl Storable for String

Source§

impl<T> Storable for Option<T>
where T: Storable,

Source§

impl<T, U> Storable for (T, U)
where T: Storable, U: Storable,

Implementors§