pub struct SqliteEngine {
db_path: PathBuf,
connection: Connection,
read_pool: Arc<CoreResourceThreadPool>,
write_pool: Arc<CoreResourceThreadPool>,
}
Fields§
§db_path: PathBuf
§connection: Connection
§read_pool: Arc<CoreResourceThreadPool>
§write_pool: Arc<CoreResourceThreadPool>
Implementations§
Source§impl SqliteEngine
impl SqliteEngine
pub fn new( base_dir: &Path, db_info: &IndexedDBDescription, pool: Arc<CoreResourceThreadPool>, ) -> Result<Self, Error>
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 put_item( connection: &Connection, store: Model, serialized_key: Vec<u8>, value: Vec<u8>, should_overwrite: bool, ) -> Result<PutItemResult, Error>
fn delete_item( connection: &Connection, store: Model, serialized_key: Vec<u8>, ) -> Result<(), Error>
fn clear(connection: &Connection, store: Model) -> Result<(), Error>
fn count( connection: &Connection, store: Model, key_range: IndexedDBKeyRange, ) -> Result<usize, Error>
fn generate_key( connection: &Connection, store: &Model, ) -> Result<IndexedDBKeyType, 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, ) -> Receiver<Option<Vec<u8>>>
fn has_key_generator(&self, store_name: &str) -> bool
fn key_path(&self, store_name: &str) -> Option<KeyPath>
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>
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