Trait ReadTransaction

Source
pub trait ReadTransaction {
    // Required methods
    fn get(
        &self,
        prefix: u8,
        key: &Vec<u8>,
        suffix: Option<u8>,
        family: &Option<String>,
    ) -> Result<Vec<u8>, StorageError>;
    fn get_all(
        &self,
        prefix: u8,
        key: &Vec<u8>,
        suffix: Option<u8>,
        family: &Option<String>,
    ) -> Result<Vec<Vec<u8>>, StorageError>;
    fn get_all_properties_of_key(
        &self,
        prefix: u8,
        key: Vec<u8>,
        properties: Vec<u8>,
        family: &Option<String>,
    ) -> Result<HashMap<u8, Vec<u8>>, StorageError>;
    fn has_property_value(
        &self,
        prefix: u8,
        key: &Vec<u8>,
        suffix: Option<u8>,
        value: &Vec<u8>,
        family: &Option<String>,
    ) -> Result<(), StorageError>;
    fn get_all_keys_and_values(
        &self,
        prefix: u8,
        key_size: usize,
        key_prefix: Vec<u8>,
        suffix: Option<u8>,
        family: &Option<String>,
    ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, StorageError>;
}

Required Methods§

Source

fn get( &self, prefix: u8, key: &Vec<u8>, suffix: Option<u8>, family: &Option<String>, ) -> Result<Vec<u8>, StorageError>

Load a property from the store.

Source

fn get_all( &self, prefix: u8, key: &Vec<u8>, suffix: Option<u8>, family: &Option<String>, ) -> Result<Vec<Vec<u8>>, StorageError>

👎Deprecated: KVStore has unique values (since switch from lmdb to rocksdb) use get() instead

Load all the values of a property from the store.

Source

fn get_all_properties_of_key( &self, prefix: u8, key: Vec<u8>, properties: Vec<u8>, family: &Option<String>, ) -> Result<HashMap<u8, Vec<u8>>, StorageError>

Source

fn has_property_value( &self, prefix: u8, key: &Vec<u8>, suffix: Option<u8>, value: &Vec<u8>, family: &Option<String>, ) -> Result<(), StorageError>

Check if a specific value exists for a property from the store.

Source

fn get_all_keys_and_values( &self, prefix: u8, key_size: usize, key_prefix: Vec<u8>, suffix: Option<u8>, family: &Option<String>, ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, StorageError>

retrieves all the keys and values with the given prefix and key_size. if no suffix is specified, then all (including none) the suffices are returned

Implementors§