Trait akd::storage::Storable [−][src]
pub trait Storable: Clone + Serialize + DeserializeOwned + Sync {
type Key: Clone + Serialize + Eq + Hash + Send + Sync + Debug;
fn data_type() -> StorageType;
fn get_id(&self) -> Self::Key;
fn get_full_binary_key_id(key: &Self::Key) -> Vec<u8>;
fn key_from_full_binary(bin: &[u8]) -> Result<Self::Key, String>;
fn get_full_binary_id(&self) -> Vec<u8> { ... }
}
Expand description
Storable represents an item which can be stored in the storage layer
Associated Types
Required methods
fn data_type() -> StorageType
fn data_type() -> StorageType
Must return a valid storage type
Retrieve an instance of the id of this storable. The combination of the storable’s StorageType and this id are globally unique
fn get_full_binary_key_id(key: &Self::Key) -> Vec<u8>
fn get_full_binary_key_id(key: &Self::Key) -> Vec<u8>
Retrieve the full binary version of a key (for comparisons)
Provided methods
fn get_full_binary_id(&self) -> Vec<u8>
fn get_full_binary_id(&self) -> Vec<u8>
Retrieve the full binary version of a key (for comparisons)