pub struct SqliteEngine {
db_path: PathBuf,
connection: Connection,
read_pool: Arc<ThreadPool>,
write_pool: Arc<ThreadPool>,
created_db_path: bool,
}Fields§
§db_path: PathBuf§connection: Connection§read_pool: Arc<ThreadPool>§write_pool: Arc<ThreadPool>§created_db_path: boolImplementations§
Source§impl SqliteEngine
impl SqliteEngine
pub fn new( base_dir: &Path, db_info: &IndexedDBDescription, pool: Arc<ThreadPool>, ) -> Result<Self, Error>
Sourcepub(crate) fn created_db_path(&self) -> bool
pub(crate) fn created_db_path(&self) -> bool
Returns whether the physical db was created as part of new.
fn init_db( path: &Path, db_info: &IndexedDBDescription, ) -> Result<Connection, Error>
fn get( connection: &Connection, store: Model, key_range: IndexedDBKeyRange, ) -> Result<Option<Model>, Error>
fn get_key( connection: &Connection, store: Model, key_range: IndexedDBKeyRange, ) -> Result<Option<Vec<u8>>, Error>
fn get_item( connection: &Connection, store: Model, key_range: IndexedDBKeyRange, ) -> Result<Option<Vec<u8>>, Error>
fn get_all( connection: &Connection, store: Model, key_range: IndexedDBKeyRange, count: Option<u32>, ) -> Result<Vec<Model>, Error>
fn get_all_keys( connection: &Connection, store: Model, key_range: IndexedDBKeyRange, count: Option<u32>, ) -> Result<Vec<Vec<u8>>, Error>
fn get_all_items( connection: &Connection, store: Model, key_range: IndexedDBKeyRange, count: Option<u32>, ) -> Result<Vec<Vec<u8>>, Error>
fn get_all_records( connection: &Connection, store: Model, key_range: IndexedDBKeyRange, ) -> Result<Vec<(Vec<u8>, Vec<u8>)>, Error>
fn put_item( connection: &Connection, store: Model, key: IndexedDBKeyType, value: Vec<u8>, should_overwrite: bool, key_generator_current_number: Option<i32>, ) -> Result<PutItemResult, Error>
fn delete_item( connection: &Connection, store: Model, key_range: IndexedDBKeyRange, ) -> Result<(), Error>
fn clear(connection: &Connection, store: Model) -> Result<(), Error>
fn count( connection: &Connection, store: Model, key_range: IndexedDBKeyRange, ) -> Result<usize, Error>
Trait Implementations§
Source§impl KvsEngine for SqliteEngine
impl KvsEngine for SqliteEngine
type Error = Error
fn create_store( &self, store_name: &str, key_path: Option<KeyPath>, auto_increment: bool, ) -> Result<CreateObjectResult, Self::Error>
fn delete_store(&self, store_name: &str) -> Result<(), Self::Error>
fn close_store(&self, _store_name: &str) -> Result<(), Self::Error>
fn delete_database(self) -> Result<(), Self::Error>
fn process_transaction( &self, transaction: KvsTransaction, on_complete: Box<dyn FnOnce() + Send + 'static>, )
fn key_generator_current_number(&self, store_name: &str) -> Option<i32>
fn key_path(&self, store_name: &str) -> Option<KeyPath>
fn object_store_names(&self) -> Result<Vec<String>, Self::Error>
fn indexes(&self, store_name: &str) -> Result<Vec<IndexedDBIndex>, Self::Error>
fn create_index( &self, store_name: &str, index_name: String, key_path: KeyPath, unique: bool, multi_entry: bool, ) -> Result<CreateObjectResult, Self::Error>
fn delete_index( &self, store_name: &str, index_name: String, ) -> Result<(), Self::Error>
fn version(&self) -> Result<u64, Self::Error>
fn set_version(&self, version: u64) -> Result<(), Self::Error>
Source§impl MallocSizeOf for SqliteEngine
impl MallocSizeOf for SqliteEngine
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Auto Trait Implementations§
impl !Freeze for SqliteEngine
impl !RefUnwindSafe for SqliteEngine
impl Send for SqliteEngine
impl !Sync for SqliteEngine
impl Unpin for SqliteEngine
impl !UnwindSafe for SqliteEngine
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert