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§