pub struct KvdbSqlite<ValueType> { /* private fields */ }Implementations§
Source§impl<ValueType> KvdbSqlite<ValueType>
impl<ValueType> KvdbSqlite<ValueType>
pub fn new( connection: Option<SqliteConnection>, statements: Arc<KvdbSqliteStatements>, ) -> Result<Self>
pub fn into_connection(self) -> Option<SqliteConnection>
Source§impl<ValueType> KvdbSqlite<ValueType>
impl<ValueType> KvdbSqlite<ValueType>
pub fn try_clone(&self) -> Result<Self>
pub fn open<P: AsRef<Path>>( path: P, readonly: bool, statements: Arc<KvdbSqliteStatements>, ) -> Result<Self>
pub fn open_or_create<P: AsRef<Path>>( path: P, statements: Arc<KvdbSqliteStatements>, unsafe_mode: bool, ) -> Result<(bool, Self)>
pub fn create_and_open<P: AsRef<Path>>( path: P, statements: Arc<KvdbSqliteStatements>, create_table: bool, unsafe_mode: bool, ) -> Result<Self>
pub fn create_table( connection: &mut SqliteConnection, statements: &KvdbSqliteStatements, ) -> Result<()>
pub fn check_if_table_exist( connection: &mut SqliteConnection, statements: &KvdbSqliteStatements, ) -> Result<bool>
pub fn drop_table( connection: &mut SqliteConnection, statements: &KvdbSqliteStatements, ) -> Result<()>
pub fn vacuum_db( connection: &mut SqliteConnection, statements: &KvdbSqliteStatements, ) -> Result<()>
Source§impl<ValueType: ValueRead + ValueReadImpl<<ValueType as ValueRead>::Kind>> KvdbSqlite<ValueType>
impl<ValueType: ValueRead + ValueReadImpl<<ValueType as ValueRead>::Kind>> KvdbSqlite<ValueType>
pub fn from_row(row: &Statement<'_>) -> Result<ValueType>
pub fn kv_from_iter_row<Key: Default + SqlReadableIntoSelf>( row: &Statement<'_>, ) -> Result<(Key, ValueType)>
Trait Implementations§
Source§impl<ValueType> DbImplFamily for KvdbSqlite<ValueType>
impl<ValueType> DbImplFamily for KvdbSqlite<ValueType>
type FamilyRepresentative = KvdbSqlite<ValueType>
Source§impl DerefMutPlusSelf for KvdbSqlite<Box<[u8]>>
impl DerefMutPlusSelf for KvdbSqlite<Box<[u8]>>
Source§impl DerefPlusSelf for KvdbSqlite<Box<[u8]>>
impl DerefPlusSelf for KvdbSqlite<Box<[u8]>>
impl<ValueType: DbValueType + ValueRead + ValueReadImpl<<ValueType as ValueRead>::Kind>> KeyValueDbTraitMultiReader for KvdbSqlite<ValueType>
Source§impl<ValueType: 'static + DbValueType + ValueRead + ValueReadImpl<<ValueType as ValueRead>::Kind>> KeyValueDbTraitTransactional for KvdbSqlite<ValueType>
impl<ValueType: 'static + DbValueType + ValueRead + ValueReadImpl<<ValueType as ValueRead>::Kind>> KeyValueDbTraitTransactional for KvdbSqlite<ValueType>
type TransactionType = KvdbSqliteTransaction<ValueType>
Source§fn start_transaction(
&self,
immediate_write: bool,
) -> Result<KvdbSqliteTransaction<ValueType>>
fn start_transaction( &self, immediate_write: bool, ) -> Result<KvdbSqliteTransaction<ValueType>>
Immediate_write indicates whether the transaction should acquire a
write-lock immediately if any.
Source§impl<ValueType: DbValueType> KeyValueDbTypes for KvdbSqlite<ValueType>
impl<ValueType: DbValueType> KeyValueDbTypes for KvdbSqlite<ValueType>
Source§impl<ValueType> MallocSizeOf for KvdbSqlite<ValueType>
impl<ValueType> MallocSizeOf for KvdbSqlite<ValueType>
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.
Source§impl<ValueType> OwnedReadImplFamily for KvdbSqlite<ValueType>
impl<ValueType> OwnedReadImplFamily for KvdbSqlite<ValueType>
type FamilyRepresentative = KvdbSqlite<ValueType>
Source§impl<ValueType> ReadImplFamily for KvdbSqlite<ValueType>
impl<ValueType> ReadImplFamily for KvdbSqlite<ValueType>
type FamilyRepresentative = KvdbSqlite<ValueType>
Source§impl<ValueType> SingleWriterImplFamily for KvdbSqlite<ValueType>
impl<ValueType> SingleWriterImplFamily for KvdbSqlite<ValueType>
type FamilyRepresentative = KvdbSqlite<ValueType>
Auto Trait Implementations§
impl<ValueType> !Freeze for KvdbSqlite<ValueType>
impl<ValueType> !RefUnwindSafe for KvdbSqlite<ValueType>
impl<ValueType> !UnwindSafe for KvdbSqlite<ValueType>
impl<ValueType> Forget for KvdbSqlite<ValueType>
impl<ValueType> Move for KvdbSqlite<ValueType>
impl<ValueType> Send for KvdbSqlite<ValueType>where
PhantomData<ValueType>: Send,
impl<ValueType> Sync for KvdbSqlite<ValueType>where
PhantomData<ValueType>: Sync,
impl<ValueType> Unpin for KvdbSqlite<ValueType>where
PhantomData<ValueType>: Unpin,
impl<ValueType> UnsafeUnpin for KvdbSqlite<ValueType>where
PhantomData<ValueType>: UnsafeUnpin,
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, ValueType> DbImplByFamily<KvdbSqlite<ValueType>> for Twhere
T: DbImplFamily<FamilyRepresentative = KvdbSqlite<ValueType>> + KvdbSqliteRefDestructureTrait + KeyValueDbTypes<ValueType = ValueType>,
ValueType: DbValueType,
<ValueType as DbValueType>::Type: SqlBindableValue + BindValueAppendImpl<<<ValueType as DbValueType>::Type as SqlBindableValue>::Kind>,
impl<T, ValueType> DbImplByFamily<KvdbSqlite<ValueType>> for Twhere
T: DbImplFamily<FamilyRepresentative = KvdbSqlite<ValueType>> + KvdbSqliteRefDestructureTrait + KeyValueDbTypes<ValueType = ValueType>,
ValueType: DbValueType,
<ValueType as DbValueType>::Type: SqlBindableValue + BindValueAppendImpl<<<ValueType as DbValueType>::Type as SqlBindableValue>::Kind>,
fn delete_impl( &self, key: &[u8], ) -> Result<Option<Option<<T as KeyValueDbTypes>::ValueType>>, Error>
fn delete_with_number_key_impl( &self, key: i64, ) -> Result<Option<Option<<T as KeyValueDbTypes>::ValueType>>, Error>
fn put_impl( &self, key: &[u8], value: &<<T as KeyValueDbTypes>::ValueType as DbValueType>::Type, ) -> Result<Option<Option<<T as KeyValueDbTypes>::ValueType>>, Error>
fn put_with_number_key_impl( &self, key: i64, value: &<<T as KeyValueDbTypes>::ValueType as DbValueType>::Type, ) -> Result<Option<Option<<T as KeyValueDbTypes>::ValueType>>, Error>
Source§impl<T> ElementSatisfy<ElementNoConstrain> for T
impl<T> ElementSatisfy<ElementNoConstrain> for T
fn to_constrain_object(&self) -> &ElementNoConstrain
fn to_constrain_object_mut(&mut self) -> &mut ElementNoConstrain
Source§impl<T> KeyValueDbAsAnyTrait for Twhere
T: KeyValueDbTypes + Any,
impl<T> KeyValueDbAsAnyTrait for Twhere
T: KeyValueDbTypes + Any,
Source§impl<T> KeyValueDbTrait for Twhere
T: DbImplFamily + DbImplByFamily<<T as DbImplFamily>::FamilyRepresentative> + KeyValueDbTraitMultiReader + Send + Sync + MallocSizeOf,
impl<T> KeyValueDbTrait for Twhere
T: DbImplFamily + DbImplByFamily<<T as DbImplFamily>::FamilyRepresentative> + KeyValueDbTraitMultiReader + Send + Sync + MallocSizeOf,
Source§fn delete(
&self,
key: &[u8],
) -> Result<Option<Option<<T as KeyValueDbTypes>::ValueType>>, Error>
fn delete( &self, key: &[u8], ) -> Result<Option<Option<<T as KeyValueDbTypes>::ValueType>>, Error>
Return Some(maybe_old_value) or None if the db don’t support reading the
old value at deletion.
fn delete_with_number_key( &self, key: i64, ) -> Result<Option<Option<<T as KeyValueDbTypes>::ValueType>>, Error>
fn put( &self, key: &[u8], value: &<<T as KeyValueDbTypes>::ValueType as DbValueType>::Type, ) -> Result<Option<Option<<T as KeyValueDbTypes>::ValueType>>, Error>
fn put_with_number_key( &self, key: i64, value: &<<T as KeyValueDbTypes>::ValueType as DbValueType>::Type, ) -> Result<Option<Option<<T as KeyValueDbTypes>::ValueType>>, Error>
Source§impl<T> KeyValueDbTraitOwnedRead for Twhere
T: OwnedReadImplFamily + OwnedReadImplByFamily<<T as OwnedReadImplFamily>::FamilyRepresentative>,
impl<T> KeyValueDbTraitOwnedRead for Twhere
T: OwnedReadImplFamily + OwnedReadImplByFamily<<T as OwnedReadImplFamily>::FamilyRepresentative>,
Source§impl<T> KeyValueDbTraitRead for T
impl<T> KeyValueDbTraitRead for T
Source§impl<T> KeyValueDbTraitSingleWriter for T
impl<T> KeyValueDbTraitSingleWriter for T
Source§fn delete(
&mut self,
key: &[u8],
) -> Result<Option<Option<<T as KeyValueDbTypes>::ValueType>>, Error>
fn delete( &mut self, key: &[u8], ) -> Result<Option<Option<<T as KeyValueDbTypes>::ValueType>>, Error>
Return Some(maybe_old_value) or None if the db don’t support reading the
old value at deletion.