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§
Sourcefn type_description() -> String
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.