Trait coprocessor_plugin_api::RawStorage[][src]

pub trait RawStorage {
    fn get<'life0, 'async_trait>(
        &'life0 self,
        key: Key
    ) -> Pin<Box<dyn Future<Output = PluginResult<Option<Value>>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn batch_get<'life0, 'async_trait>(
        &'life0 self,
        keys: Vec<Key>
    ) -> Pin<Box<dyn Future<Output = PluginResult<Vec<KvPair>>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn scan<'life0, 'async_trait>(
        &'life0 self,
        key_range: Range<Key>
    ) -> Pin<Box<dyn Future<Output = PluginResult<Vec<Value>>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn put<'life0, 'async_trait>(
        &'life0 self,
        key: Key,
        value: Value
    ) -> Pin<Box<dyn Future<Output = PluginResult<()>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn batch_put<'life0, 'async_trait>(
        &'life0 self,
        kv_pairs: Vec<KvPair>
    ) -> Pin<Box<dyn Future<Output = PluginResult<()>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn delete<'life0, 'async_trait>(
        &'life0 self,
        key: Key
    ) -> Pin<Box<dyn Future<Output = PluginResult<()>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn batch_delete<'life0, 'async_trait>(
        &'life0 self,
        keys: Vec<Key>
    ) -> Pin<Box<dyn Future<Output = PluginResult<()>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn delete_range<'life0, 'async_trait>(
        &'life0 self,
        key_range: Range<Key>
    ) -> Pin<Box<dyn Future<Output = PluginResult<()>> + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }

Storage access for coprocessor plugins.

RawStorage allows coprocessor plugins to interact with TiKV storage on a low level.

Batch operations should be preferred due to their better performance.

Required methods

fn get<'life0, 'async_trait>(
    &'life0 self,
    key: Key
) -> Pin<Box<dyn Future<Output = PluginResult<Option<Value>>> + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Retrieves the value for a given key from the storage on the current node. Returns Option::None if the key is not present in the database.

fn batch_get<'life0, 'async_trait>(
    &'life0 self,
    keys: Vec<Key>
) -> Pin<Box<dyn Future<Output = PluginResult<Vec<KvPair>>> + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Same as RawStorage::get(), but retrieves values for multiple keys at once.

fn scan<'life0, 'async_trait>(
    &'life0 self,
    key_range: Range<Key>
) -> Pin<Box<dyn Future<Output = PluginResult<Vec<Value>>> + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Same as RawStorage::get(), but accepts a key_range such that values for keys in [key_range.start, key_range.end) are retrieved. The upper bound of the key_range is exclusive.

fn put<'life0, 'async_trait>(
    &'life0 self,
    key: Key,
    value: Value
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Inserts a new key-value pair into the storage on the current node.

fn batch_put<'life0, 'async_trait>(
    &'life0 self,
    kv_pairs: Vec<KvPair>
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Same as RawStorage::put(), but inserts multiple key-value pairs at once.

fn delete<'life0, 'async_trait>(
    &'life0 self,
    key: Key
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Deletes a key-value pair from the storage on the current node given a key. Returns [Result::Ok] if the key was successfully deleted.

fn batch_delete<'life0, 'async_trait>(
    &'life0 self,
    keys: Vec<Key>
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Same as RawStorage::delete(), but deletes multiple key-value pairs at once.

fn delete_range<'life0, 'async_trait>(
    &'life0 self,
    key_range: Range<Key>
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Same as RawStorage::delete(), but deletes multiple key-values pairs at once given a key_range. All records with keys in [key_range.start, key_range.end) will be deleted. The upper bound of the key_range is exclusive.

Loading content...

Implementors

Loading content...