Trait key_store::traits::KeyStoreValue [−][src]
Any value that is stored in the key store must implement this trait. In most cases these are the raw bytes of the object.
The generic Serialization defaults to Vec<u8> but can be defined
differently. The serialize return type SerializedValue must implement
Into<Serialization>.
Associated Types
type Error: Debug + Clone + PartialEq + Into<String>[src]
The error type returned by the KeyStoreValue.
type SerializedValue: Into<Serialization>[src]
The type of a serialized key store value.
Required methods
fn serialize(&self) -> Result<Self::SerializedValue, Self::Error>[src]
Serialize the value and return it as SerializedValue.
Returns an Error if the serialization fails.
fn deserialize(raw: &mut [u8]) -> Result<Self, Self::Error> where
Self: Sized, [src]
Self: Sized,
Deserialize the byte slice and return the object.
Returns an Error if the deserialization fails.