Struct cfx_storage::KvdbSqlite
source · 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<T: DbImplFamily<FamilyRepresentative = KvdbSqlite<ValueType>> + KvdbSqliteRefDestructureTrait + KeyValueDbTypes<ValueType = ValueType>, ValueType: DbValueType> DbImplByFamily<KvdbSqlite<ValueType>> for T
impl<T: DbImplFamily<FamilyRepresentative = KvdbSqlite<ValueType>> + KvdbSqliteRefDestructureTrait + KeyValueDbTypes<ValueType = ValueType>, ValueType: DbValueType> DbImplByFamily<KvdbSqlite<ValueType>> for T
fn delete_impl(&self, key: &[u8]) -> Result<Option<Option<Self::ValueType>>>
fn delete_with_number_key_impl( &self, key: i64 ) -> Result<Option<Option<Self::ValueType>>>
fn put_impl( &self, key: &[u8], value: &<Self::ValueType as DbValueType>::Type ) -> Result<Option<Option<Self::ValueType>>>
fn put_with_number_key_impl( &self, key: i64, value: &<<Self as KeyValueDbTypes>::ValueType as DbValueType>::Type ) -> Result<Option<Option<Self::ValueType>>>
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]>>
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<T: SingleWriterImplFamily<FamilyRepresentative = KvdbSqlite<ValueType>> + KvdbSqliteDestructureTrait + KeyValueDbTypes<ValueType = ValueType>, ValueType: DbValueType> SingleWriterImplByFamily<KvdbSqlite<ValueType>> for T
impl<T: SingleWriterImplFamily<FamilyRepresentative = KvdbSqlite<ValueType>> + KvdbSqliteDestructureTrait + KeyValueDbTypes<ValueType = ValueType>, ValueType: DbValueType> SingleWriterImplByFamily<KvdbSqlite<ValueType>> for T
fn delete_impl(&mut self, key: &[u8]) -> Result<Option<Option<Self::ValueType>>>
fn delete_with_number_key_impl( &mut self, key: i64 ) -> Result<Option<Option<<Self as KeyValueDbTypes>::ValueType>>>
fn put_impl( &mut self, key: &[u8], value: &<Self::ValueType as DbValueType>::Type ) -> Result<Option<Option<Self::ValueType>>>
fn put_with_number_key_impl( &mut self, key: i64, value: &<Self::ValueType as DbValueType>::Type ) -> Result<Option<Option<Self::ValueType>>>
source§impl<ValueType> SingleWriterImplFamily for KvdbSqlite<ValueType>
impl<ValueType> SingleWriterImplFamily for KvdbSqlite<ValueType>
type FamilyRepresentative = KvdbSqlite<ValueType>
impl<ValueType: DbValueType + ValueRead + ValueReadImpl<<ValueType as ValueRead>::Kind>> KeyValueDbTraitMultiReader for KvdbSqlite<ValueType>
Auto Trait Implementations§
impl<ValueType> !RefUnwindSafe for KvdbSqlite<ValueType>
impl<ValueType> Send for KvdbSqlite<ValueType>where
ValueType: Send,
impl<ValueType> Sync for KvdbSqlite<ValueType>where
ValueType: Sync,
impl<ValueType> Unpin for KvdbSqlite<ValueType>where
ValueType: Unpin,
impl<ValueType> !UnwindSafe for KvdbSqlite<ValueType>
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