Trait SimpleTransaction

Source
pub trait SimpleTransaction {
Show 13 methods // Required methods fn closed(&self) -> bool; fn cancel<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn count<'life0, 'async_trait>( &'life0 mut self, cf: CF, ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn commit<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn exi<'life0, 'async_trait, K>( &'life0 self, cf: CF, key: K, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>> where K: 'async_trait + Into<Vec<u8>> + Send, Self: 'async_trait, 'life0: 'async_trait; fn get<'life0, 'async_trait, K>( &'life0 self, cf: CF, key: K, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Error>> + 'async_trait>> where K: 'async_trait + Into<Vec<u8>> + Send, Self: 'async_trait, 'life0: 'async_trait; fn set<'life0, 'async_trait, K, V>( &'life0 mut self, cf: CF, key: K, val: V, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>> where K: 'async_trait + Into<Vec<u8>> + Send, V: 'async_trait + Into<Vec<u8>> + Send, Self: 'async_trait, 'life0: 'async_trait; fn put<'life0, 'async_trait, K, V>( &'life0 mut self, cf: CF, key: K, val: V, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>> where K: 'async_trait + Into<Vec<u8>> + Send, V: 'async_trait + Into<Vec<u8>> + Send, Self: 'async_trait, 'life0: 'async_trait; fn del<'life0, 'async_trait, K>( &'life0 mut self, cf: CF, key: K, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>> where K: 'async_trait + Into<Vec<u8>> + Send, Self: 'async_trait, 'life0: 'async_trait; fn iterate<'life0, 'async_trait>( &'life0 self, cf: CF, ) -> Pin<Box<dyn Future<Output = Result<Vec<Result<(Vec<u8>, Vec<u8>), Error>>, Error>> + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn prefix_iterate<'life0, 'async_trait, P>( &'life0 self, cf: CF, prefix: P, ) -> Pin<Box<dyn Future<Output = Result<Vec<Result<(Vec<u8>, Vec<u8>), Error>>, Error>> + 'async_trait>> where P: 'async_trait + Into<Vec<u8>> + Send, Self: 'async_trait, 'life0: 'async_trait; fn suffix_iterate<'life0, 'async_trait, S>( &'life0 self, cf: CF, suffix: S, ) -> Pin<Box<dyn Future<Output = Result<Vec<Result<(Vec<u8>, Vec<u8>), Error>>, Error>> + 'async_trait>> where S: 'async_trait + Into<Vec<u8>> + Send, Self: 'async_trait, 'life0: 'async_trait; // Provided method fn multi_get<'life0, 'async_trait, K>( &'life0 self, _cf: CF, _keys: Vec<K>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<Vec<u8>>>, Error>> + 'async_trait>> where K: 'async_trait + Into<Vec<u8>> + Send + AsRef<[u8]>, Self: 'async_trait, 'life0: 'async_trait { ... }
}

Required Methods§

Source

fn closed(&self) -> bool

Source

fn cancel<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn count<'life0, 'async_trait>( &'life0 mut self, cf: CF, ) -> Pin<Box<dyn Future<Output = Result<usize, Error>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn commit<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn exi<'life0, 'async_trait, K>( &'life0 self, cf: CF, key: K, ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + 'async_trait>>
where K: 'async_trait + Into<Vec<u8>> + Send, Self: 'async_trait, 'life0: 'async_trait,

Source

fn get<'life0, 'async_trait, K>( &'life0 self, cf: CF, key: K, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Error>> + 'async_trait>>
where K: 'async_trait + Into<Vec<u8>> + Send, Self: 'async_trait, 'life0: 'async_trait,

Fetch a key from the database

Source

fn set<'life0, 'async_trait, K, V>( &'life0 mut self, cf: CF, key: K, val: V, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>
where K: 'async_trait + Into<Vec<u8>> + Send, V: 'async_trait + Into<Vec<u8>> + Send, Self: 'async_trait, 'life0: 'async_trait,

Insert or update a key in the database

Source

fn put<'life0, 'async_trait, K, V>( &'life0 mut self, cf: CF, key: K, val: V, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>
where K: 'async_trait + Into<Vec<u8>> + Send, V: 'async_trait + Into<Vec<u8>> + Send, Self: 'async_trait, 'life0: 'async_trait,

Insert a key if it doesn’t exist in the database

Source

fn del<'life0, 'async_trait, K>( &'life0 mut self, cf: CF, key: K, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>
where K: 'async_trait + Into<Vec<u8>> + Send, Self: 'async_trait, 'life0: 'async_trait,

Delete a key

Source

fn iterate<'life0, 'async_trait>( &'life0 self, cf: CF, ) -> Pin<Box<dyn Future<Output = Result<Vec<Result<(Vec<u8>, Vec<u8>), Error>>, Error>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn prefix_iterate<'life0, 'async_trait, P>( &'life0 self, cf: CF, prefix: P, ) -> Pin<Box<dyn Future<Output = Result<Vec<Result<(Vec<u8>, Vec<u8>), Error>>, Error>> + 'async_trait>>
where P: 'async_trait + Into<Vec<u8>> + Send, Self: 'async_trait, 'life0: 'async_trait,

Source

fn suffix_iterate<'life0, 'async_trait, S>( &'life0 self, cf: CF, suffix: S, ) -> Pin<Box<dyn Future<Output = Result<Vec<Result<(Vec<u8>, Vec<u8>), Error>>, Error>> + 'async_trait>>
where S: 'async_trait + Into<Vec<u8>> + Send, Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn multi_get<'life0, 'async_trait, K>( &'life0 self, _cf: CF, _keys: Vec<K>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<Vec<u8>>>, Error>> + 'async_trait>>
where K: 'async_trait + Into<Vec<u8>> + Send + AsRef<[u8]>, Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§