Struct gluesql_sled_storage::SledStorage
source · pub struct SledStorage {
pub tree: Db,
pub id_offset: u64,
pub state: State,
pub tx_timeout: Option<u128>,
}
Fields§
§tree: Db
§id_offset: u64
§state: State
§tx_timeout: Option<u128>
transaction timeout in milliseconds
Implementations§
source§impl SledStorage
impl SledStorage
pub fn rollback_txid(&self, txid: u64) -> Result<()>
pub fn check_retry( &mut self, tx_result: StdResult<TxPayload, TransactionError<Error>> ) -> Result<bool>
source§impl SledStorage
impl SledStorage
pub fn new(filename: &str) -> Result<Self>
pub fn set_transaction_timeout(&mut self, tx_timeout: Option<u128>)
pub fn export( &self ) -> Result<(u64, Vec<(Vec<u8>, Vec<u8>, impl Iterator<Item = Vec<Vec<u8>>>)>)>
pub fn import( &mut self, export: (u64, Vec<(Vec<u8>, Vec<u8>, impl Iterator<Item = Vec<Vec<u8>>>)>) ) -> Result<()>
Trait Implementations§
source§impl AlterTable for SledStorage
impl AlterTable for SledStorage
fn rename_schema<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, table_name: &'life1 str, new_table_name: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
fn rename_column<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, table_name: &'life1 str, old_column_name: &'life2 str, new_column_name: &'life3 str ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,
fn add_column<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, table_name: &'life1 str, column_def: &'life2 ColumnDef ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
fn drop_column<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, table_name: &'life1 str, column_name: &'life2 str, if_exists: bool ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
source§impl Clone for SledStorage
impl Clone for SledStorage
source§fn clone(&self) -> SledStorage
fn clone(&self) -> SledStorage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl CustomFunction for SledStorage
impl CustomFunction for SledStorage
fn fetch_function<'life0, 'life1, 'async_trait>( &'life0 self, _func_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Option<&'life0 CustomFunction>, Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,
fn fetch_all_functions<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<&'life0 CustomFunction>, Error>> + 'async_trait>>where 'life0: 'async_trait, Self: 'async_trait,
source§impl CustomFunctionMut for SledStorage
impl CustomFunctionMut for SledStorage
fn insert_function<'life0, 'async_trait>( &'life0 mut self, _func: CustomFunction ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, Self: 'async_trait,
fn delete_function<'life0, 'life1, 'async_trait>( &'life0 mut self, _func_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + 'async_trait>>where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,
source§impl Debug for SledStorage
impl Debug for SledStorage
source§impl Index for SledStorage
impl Index for SledStorage
fn scan_indexed_data<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, table_name: &'life1 str, index_name: &'life2 str, asc: Option<bool>, cmp_value: Option<(&'life3 IndexOperator, Value)> ) -> Pin<Box<dyn Future<Output = Result<RowIter>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,
source§impl IndexMut for SledStorage
impl IndexMut for SledStorage
fn create_index<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, table_name: &'life1 str, index_name: &'life2 str, column: &'life3 OrderByExpr ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,
fn drop_index<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, table_name: &'life1 str, index_name: &'life2 str ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
source§impl Metadata for SledStorage
impl Metadata for SledStorage
source§impl Store for SledStorage
impl Store for SledStorage
fn fetch_all_schemas<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<Schema>>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fn fetch_schema<'life0, 'life1, 'async_trait>( &'life0 self, table_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<Option<Schema>>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
fn fetch_data<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, table_name: &'life1 str, key: &'life2 Key ) -> Pin<Box<dyn Future<Output = Result<Option<DataRow>>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
fn scan_data<'life0, 'life1, 'async_trait>( &'life0 self, table_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<RowIter>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
source§impl StoreMut for SledStorage
impl StoreMut for SledStorage
fn insert_schema<'life0, 'life1, 'async_trait>( &'life0 mut self, schema: &'life1 Schema ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
fn delete_schema<'life0, 'life1, 'async_trait>( &'life0 mut self, table_name: &'life1 str ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
fn append_data<'life0, 'life1, 'async_trait>( &'life0 mut self, table_name: &'life1 str, rows: Vec<DataRow> ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
fn insert_data<'life0, 'life1, 'async_trait>( &'life0 mut self, table_name: &'life1 str, rows: Vec<(Key, DataRow)> ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
fn delete_data<'life0, 'life1, 'async_trait>( &'life0 mut self, table_name: &'life1 str, keys: Vec<Key> ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
source§impl Transaction for SledStorage
impl Transaction for SledStorage
fn begin<'life0, 'async_trait>( &'life0 mut self, autocommit: bool ) -> Pin<Box<dyn Future<Output = Result<bool>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fn rollback<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
fn commit<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for SledStorage
impl Send for SledStorage
impl Sync for SledStorage
impl Unpin for SledStorage
impl !UnwindSafe for SledStorage
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more