fedimint_core::db

Trait IDatabaseTransactionOpsCore

source
pub trait IDatabaseTransactionOpsCore: MaybeSend {
    // Required methods
    fn raw_insert_bytes<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        key: &'life1 [u8],
        value: &'life2 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn raw_get_bytes<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        key: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn raw_remove_entry<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        key: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn raw_find_by_prefix<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        key_prefix: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<PrefixStream<'_>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn raw_find_by_prefix_sorted_descending<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        key_prefix: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<PrefixStream<'_>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn raw_find_by_range<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        range: Range<&'life1 [u8]>,
    ) -> Pin<Box<dyn Future<Output = Result<PrefixStream<'_>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn raw_remove_by_prefix<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        key_prefix: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Core raw a operations database transactions supports

Used to enforce the same signature on all types supporting it

Required Methods§

source

fn raw_insert_bytes<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, key: &'life1 [u8], value: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Insert entry

source

fn raw_get_bytes<'life0, 'life1, 'async_trait>( &'life0 mut self, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get key value

source

fn raw_remove_entry<'life0, 'life1, 'async_trait>( &'life0 mut self, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove entry by key

source

fn raw_find_by_prefix<'life0, 'life1, 'async_trait>( &'life0 mut self, key_prefix: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<PrefixStream<'_>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns an stream of key-value pairs with keys that start with key_prefix, sorted by key.

source

fn raw_find_by_prefix_sorted_descending<'life0, 'life1, 'async_trait>( &'life0 mut self, key_prefix: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<PrefixStream<'_>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Same as Self::raw_find_by_prefix but the order is descending by key.

source

fn raw_find_by_range<'life0, 'life1, 'async_trait>( &'life0 mut self, range: Range<&'life1 [u8]>, ) -> Pin<Box<dyn Future<Output = Result<PrefixStream<'_>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns an stream of key-value pairs with keys within a range, sorted by key. Range is an (half-open) range bounded inclusively below and exclusively above.

source

fn raw_remove_by_prefix<'life0, 'life1, 'async_trait>( &'life0 mut self, key_prefix: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete keys matching prefix

Implementations on Foreign Types§

source§

impl<T> IDatabaseTransactionOpsCore for &mut T

source§

fn raw_insert_bytes<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, key: &'life1 [u8], value: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn raw_get_bytes<'life0, 'life1, 'async_trait>( &'life0 mut self, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn raw_remove_entry<'life0, 'life1, 'async_trait>( &'life0 mut self, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn raw_find_by_prefix<'life0, 'life1, 'async_trait>( &'life0 mut self, key_prefix: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<PrefixStream<'_>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn raw_find_by_prefix_sorted_descending<'life0, 'life1, 'async_trait>( &'life0 mut self, key_prefix: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<PrefixStream<'_>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn raw_find_by_range<'life0, 'life1, 'async_trait>( &'life0 mut self, range: Range<&'life1 [u8]>, ) -> Pin<Box<dyn Future<Output = Result<PrefixStream<'_>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn raw_remove_by_prefix<'life0, 'life1, 'async_trait>( &'life0 mut self, key_prefix: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T> IDatabaseTransactionOpsCore for Box<T>

source§

fn raw_insert_bytes<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, key: &'life1 [u8], value: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn raw_get_bytes<'life0, 'life1, 'async_trait>( &'life0 mut self, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn raw_remove_entry<'life0, 'life1, 'async_trait>( &'life0 mut self, key: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn raw_find_by_prefix<'life0, 'life1, 'async_trait>( &'life0 mut self, key_prefix: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<PrefixStream<'_>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn raw_find_by_prefix_sorted_descending<'life0, 'life1, 'async_trait>( &'life0 mut self, key_prefix: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<PrefixStream<'_>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn raw_find_by_range<'life0, 'life1, 'async_trait>( &'life0 mut self, range: Range<&'life1 [u8]>, ) -> Pin<Box<dyn Future<Output = Result<PrefixStream<'_>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn raw_remove_by_prefix<'life0, 'life1, 'async_trait>( &'life0 mut self, key_prefix: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§