pub trait Storage {
Show 13 methods
// Required methods
fn get_individual(
&mut self,
storage: StorageId,
id: &str,
iraw: &mut Individual,
) -> StorageResult<()>;
fn get_value(
&mut self,
storage: StorageId,
key: &str,
) -> StorageResult<String>;
fn get_raw_value(
&mut self,
storage: StorageId,
key: &str,
) -> StorageResult<Vec<u8>>;
fn put_value(
&mut self,
storage: StorageId,
key: &str,
val: &str,
) -> StorageResult<()>;
fn put_raw_value(
&mut self,
storage: StorageId,
key: &str,
val: Vec<u8>,
) -> StorageResult<()>;
fn remove_value(
&mut self,
storage: StorageId,
key: &str,
) -> StorageResult<()>;
fn count(&mut self, storage: StorageId) -> StorageResult<usize>;
// Provided methods
fn get_individual_from_db(
&mut self,
storage: StorageId,
id: &str,
iraw: &mut Individual,
) -> StorageResult<()> { ... }
fn get_v(&mut self, storage: StorageId, key: &str) -> Option<String> { ... }
fn get_raw(&mut self, storage: StorageId, key: &str) -> Vec<u8> โ { ... }
fn put_kv(&mut self, storage: StorageId, key: &str, val: &str) -> bool { ... }
fn put_kv_raw(
&mut self,
storage: StorageId,
key: &str,
val: Vec<u8>,
) -> bool { ... }
fn remove(&mut self, storage: StorageId, key: &str) -> bool { ... }
}Required Methodsยง
fn get_individual( &mut self, storage: StorageId, id: &str, iraw: &mut Individual, ) -> StorageResult<()>
fn get_value(&mut self, storage: StorageId, key: &str) -> StorageResult<String>
fn get_raw_value( &mut self, storage: StorageId, key: &str, ) -> StorageResult<Vec<u8>>
fn put_value( &mut self, storage: StorageId, key: &str, val: &str, ) -> StorageResult<()>
fn put_raw_value( &mut self, storage: StorageId, key: &str, val: Vec<u8>, ) -> StorageResult<()>
fn remove_value(&mut self, storage: StorageId, key: &str) -> StorageResult<()>
fn count(&mut self, storage: StorageId) -> StorageResult<usize>
Provided Methodsยง
fn get_individual_from_db( &mut self, storage: StorageId, id: &str, iraw: &mut Individual, ) -> StorageResult<()>
๐Deprecated since 0.1.0: Use get_individual instead
fn get_v(&mut self, storage: StorageId, key: &str) -> Option<String>
๐Deprecated since 0.1.0: Use get_value instead
fn get_raw(&mut self, storage: StorageId, key: &str) -> Vec<u8> โ
๐Deprecated since 0.1.0: Use get_raw_value instead
fn put_kv(&mut self, storage: StorageId, key: &str, val: &str) -> bool
๐Deprecated since 0.1.0: Use put_value instead
fn put_kv_raw(&mut self, storage: StorageId, key: &str, val: Vec<u8>) -> bool
๐Deprecated since 0.1.0: Use put_raw_value instead
fn remove(&mut self, storage: StorageId, key: &str) -> bool
๐Deprecated since 0.1.0: Use remove_value instead