pub trait StoreSerializer {
// Required methods
fn serialize_to_json(&self) -> Result<String, String>;
fn deserialize_from_json(
json: &str,
) -> Result<HashMap<String, Entry>, String>;
fn serialize_entry_to_json(entry: &Entry) -> Result<String, String>;
fn deserialize_entry_from_json(json: &str) -> Result<Entry, String>;
}Expand description
Serialization utilities for KvStore
Required Methods§
Sourcefn serialize_to_json(&self) -> Result<String, String>
fn serialize_to_json(&self) -> Result<String, String>
Serialize the entire store to a JSON string
Sourcefn deserialize_from_json(json: &str) -> Result<HashMap<String, Entry>, String>
fn deserialize_from_json(json: &str) -> Result<HashMap<String, Entry>, String>
Deserialize the entire store from a JSON string
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.