Trait FdbStore

Source
pub trait FdbStore:
    Send
    + Sync
    + Debug
    + Sized
    + Clone {
Show 16 methods // Required methods fn load<'life0, 'async_trait, T>( db: Arc<Database>, key: &'life0 T, ) -> Pin<Box<dyn Future<Output = Result<Self, KvError>> + Send + 'async_trait>> where T: Serialize + Sync + Sized + 'async_trait, Self: 'async_trait, 'life0: 'async_trait; fn load_in_trx<'life0, 'life1, 'async_trait, T>( trx: &'life0 RetryableTransaction, key: &'life1 T, ) -> Pin<Box<dyn Future<Output = Result<Self, FdbBindingError>> + Send + 'async_trait>> where T: Serialize + Sync + Sized + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn load_by_range<'async_trait, T>( db: Arc<Database>, query: RangeQuery<T>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, KvError>> + Send + 'async_trait>> where T: Serialize + Sync + Sized + Send + Clone + 'async_trait, Self: 'async_trait; fn load_by_range_in_trx<'life0, 'async_trait, T>( trx: &'life0 RetryableTransaction, query: RangeQuery<T>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, FdbBindingError>> + Send + 'async_trait>> where T: Serialize + Sync + Sized + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait; fn save<'life0, 'async_trait>( &'life0 self, db: Arc<Database>, ) -> Pin<Box<dyn Future<Output = Result<(), KvError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn save_in_trx<'life0, 'life1, 'async_trait>( &'life0 self, trx: &'life1 RetryableTransaction, ) -> Pin<Box<dyn Future<Output = Result<(), FdbBindingError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete<'life0, 'async_trait>( &'life0 self, db: Arc<Database>, ) -> Pin<Box<dyn Future<Output = Result<(), KvError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn delete_in_trx<'life0, 'life1, 'async_trait>( &'life0 self, trx: &'life1 RetryableTransaction, ) -> Pin<Box<dyn Future<Output = Result<(), FdbBindingError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update<'life0, 'async_trait>( &'life0 self, db: Arc<Database>, new_value: Self, ) -> Pin<Box<dyn Future<Output = Result<(), KvError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn update_in_trx<'life0, 'life1, 'async_trait>( &'life0 self, trx: &'life1 RetryableTransaction, new_value: Self, ) -> Pin<Box<dyn Future<Output = Result<(), FdbBindingError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn find_by_index<'life0, 'async_trait, T>( db: Arc<Database>, index_name: &'life0 str, index_value: T, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, KvError>> + Send + 'async_trait>> where T: Serialize + Sync + Sized + Send + Clone + 'async_trait, Self: 'async_trait, 'life0: 'async_trait; fn find_by_index_in_trx<'life0, 'life1, 'async_trait, T>( trx: &'life0 RetryableTransaction, index_name: &'life1 str, index_value: T, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, FdbBindingError>> + Send + 'async_trait>> where T: Serialize + Sync + Sized + Send + Clone + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn find_by_unique_index<'life0, 'async_trait, T>( db: Arc<Database>, index_name: &'life0 str, index_value: T, ) -> Pin<Box<dyn Future<Output = Result<Self, KvError>> + Send + 'async_trait>> where T: Serialize + Sync + Sized + Send + Clone + 'async_trait, Self: 'async_trait, 'life0: 'async_trait; fn find_by_unique_index_in_trx<'life0, 'life1, 'async_trait, T>( trx: &'life0 RetryableTransaction, index_name: &'life1 str, index_value: T, ) -> Pin<Box<dyn Future<Output = Result<Self, FdbBindingError>> + Send + 'async_trait>> where T: Serialize + Sync + Sized + Send + Clone + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn find_by_unique_index_range<'life0, 'async_trait, T>( db: Arc<Database>, index_name: &'life0 str, query: RangeQuery<T>, ignore_first_result: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, KvError>> + Send + 'async_trait>> where T: Serialize + Sync + Sized + Send + Clone + 'async_trait, Self: 'async_trait, 'life0: 'async_trait; fn find_by_unique_index_in_trx_range<'life0, 'life1, 'async_trait, T>( trx: &'life0 RetryableTransaction, index_name: &'life1 str, query: RangeQuery<T>, ignore_first_result: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, FdbBindingError>> + Send + 'async_trait>> where T: Serialize + Sync + Sized + Send + Clone + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait;
}
Expand description

FdbStore trait define all methods implemented by fdb_derive module.

Required Methods§

Source

fn load<'life0, 'async_trait, T>( db: Arc<Database>, key: &'life0 T, ) -> Pin<Box<dyn Future<Output = Result<Self, KvError>> + Send + 'async_trait>>
where T: Serialize + Sync + Sized + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Load struct from FDB via primary key identified by fdb_key attribute

Source

fn load_in_trx<'life0, 'life1, 'async_trait, T>( trx: &'life0 RetryableTransaction, key: &'life1 T, ) -> Pin<Box<dyn Future<Output = Result<Self, FdbBindingError>> + Send + 'async_trait>>
where T: Serialize + Sync + Sized + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load struct from FDB via primary key identified by fdb_key attribute in an existing transaction context

Source

fn load_by_range<'async_trait, T>( db: Arc<Database>, query: RangeQuery<T>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, KvError>> + Send + 'async_trait>>
where T: Serialize + Sync + Sized + Send + Clone + 'async_trait, Self: 'async_trait,

Load struct from FDB via primary key range identified by fdb_key attribute

Source

fn load_by_range_in_trx<'life0, 'async_trait, T>( trx: &'life0 RetryableTransaction, query: RangeQuery<T>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, FdbBindingError>> + Send + 'async_trait>>
where T: Serialize + Sync + Sized + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Load struct from FDB via primary key range identified by fdb_key attribute in an existing transaction context

Source

fn save<'life0, 'async_trait>( &'life0 self, db: Arc<Database>, ) -> Pin<Box<dyn Future<Output = Result<(), KvError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Save struct and generate all secondary indexes identified by either fdb_index or fdb_unique_index

Source

fn save_in_trx<'life0, 'life1, 'async_trait>( &'life0 self, trx: &'life1 RetryableTransaction, ) -> Pin<Box<dyn Future<Output = Result<(), FdbBindingError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save struct and generate all secondary indexes identified by either fdb_index or fdb_unique_index in an existing transaction context

Source

fn delete<'life0, 'async_trait>( &'life0 self, db: Arc<Database>, ) -> Pin<Box<dyn Future<Output = Result<(), KvError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete struct and clean up secondary indexes

Source

fn delete_in_trx<'life0, 'life1, 'async_trait>( &'life0 self, trx: &'life1 RetryableTransaction, ) -> Pin<Box<dyn Future<Output = Result<(), FdbBindingError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete struct and clean up secondary indexes in an existing transaction context

Source

fn update<'life0, 'async_trait>( &'life0 self, db: Arc<Database>, new_value: Self, ) -> Pin<Box<dyn Future<Output = Result<(), KvError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Update struct and all secondary indexes

Source

fn update_in_trx<'life0, 'life1, 'async_trait>( &'life0 self, trx: &'life1 RetryableTransaction, new_value: Self, ) -> Pin<Box<dyn Future<Output = Result<(), FdbBindingError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update struct and all secondary indexes in an existing transaction context

Source

fn find_by_index<'life0, 'async_trait, T>( db: Arc<Database>, index_name: &'life0 str, index_value: T, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, KvError>> + Send + 'async_trait>>
where T: Serialize + Sync + Sized + Send + Clone + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Find records by secondary index, the index are stored in the form key: fdb_index -> value: Vec<fdb_key>

Source

fn find_by_index_in_trx<'life0, 'life1, 'async_trait, T>( trx: &'life0 RetryableTransaction, index_name: &'life1 str, index_value: T, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, FdbBindingError>> + Send + 'async_trait>>
where T: Serialize + Sync + Sized + Send + Clone + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find records by secondary index, the index are stored in the form key: fdb_index -> value: Vec<fdb_key> in an existing transaction context

Source

fn find_by_unique_index<'life0, 'async_trait, T>( db: Arc<Database>, index_name: &'life0 str, index_value: T, ) -> Pin<Box<dyn Future<Output = Result<Self, KvError>> + Send + 'async_trait>>
where T: Serialize + Sync + Sized + Send + Clone + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Find records by secondary uniq index, the index are stored in the form key: fdb_unique_index -> value: fdb_key

Source

fn find_by_unique_index_in_trx<'life0, 'life1, 'async_trait, T>( trx: &'life0 RetryableTransaction, index_name: &'life1 str, index_value: T, ) -> Pin<Box<dyn Future<Output = Result<Self, FdbBindingError>> + Send + 'async_trait>>
where T: Serialize + Sync + Sized + Send + Clone + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find records by secondary uniq index, the index are stored in the form key: fdb_unique_index -> value: fdb_key in an existing transaction context

Source

fn find_by_unique_index_range<'life0, 'async_trait, T>( db: Arc<Database>, index_name: &'life0 str, query: RangeQuery<T>, ignore_first_result: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, KvError>> + Send + 'async_trait>>
where T: Serialize + Sync + Sized + Send + Clone + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Find records by secondary uniq index in a given range, if stop is None, the range goes to the end

Source

fn find_by_unique_index_in_trx_range<'life0, 'life1, 'async_trait, T>( trx: &'life0 RetryableTransaction, index_name: &'life1 str, query: RangeQuery<T>, ignore_first_result: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self>, FdbBindingError>> + Send + 'async_trait>>
where T: Serialize + Sync + Sized + Send + Clone + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find records by secondary uniq index in a given range, if stop is None, the range goes to the end

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§