Struct cfx_storage::KvdbSqlite

source ·
pub struct KvdbSqlite<ValueType> { /* private fields */ }

Implementations§

source§

impl<ValueType> KvdbSqlite<ValueType>

source

pub fn new( connection: Option<SqliteConnection>, statements: Arc<KvdbSqliteStatements> ) -> Result<Self>

source

pub fn into_connection(self) -> Option<SqliteConnection>

source§

impl<ValueType> KvdbSqlite<ValueType>

source

pub fn try_clone(&self) -> Result<Self>

source

pub fn open<P: AsRef<Path>>( path: P, readonly: bool, statements: Arc<KvdbSqliteStatements> ) -> Result<Self>

source

pub fn open_or_create<P: AsRef<Path>>( path: P, statements: Arc<KvdbSqliteStatements>, unsafe_mode: bool ) -> Result<(bool, Self)>

source

pub fn create_and_open<P: AsRef<Path>>( path: P, statements: Arc<KvdbSqliteStatements>, create_table: bool, unsafe_mode: bool ) -> Result<Self>

source

pub fn create_table( connection: &mut SqliteConnection, statements: &KvdbSqliteStatements ) -> Result<()>

source

pub fn check_if_table_exist( connection: &mut SqliteConnection, statements: &KvdbSqliteStatements ) -> Result<bool>

source

pub fn drop_table( connection: &mut SqliteConnection, statements: &KvdbSqliteStatements ) -> Result<()>

source

pub fn vacuum_db( connection: &mut SqliteConnection, statements: &KvdbSqliteStatements ) -> Result<()>

source§

impl<ValueType: ValueRead + ValueReadImpl<<ValueType as ValueRead>::Kind>> KvdbSqlite<ValueType>

source

pub fn from_row(row: &Statement<'_>) -> Result<ValueType>

source

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
where ValueType::Type: SqlBindableValue + BindValueAppendImpl<<ValueType::Type as SqlBindableValue>::Kind>,

source§

fn delete_impl(&self, key: &[u8]) -> Result<Option<Option<Self::ValueType>>>

source§

fn delete_with_number_key_impl( &self, key: i64 ) -> Result<Option<Option<Self::ValueType>>>

source§

fn put_impl( &self, key: &[u8], value: &<Self::ValueType as DbValueType>::Type ) -> Result<Option<Option<Self::ValueType>>>

source§

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>

source§

impl DerefMutPlusSelf for KvdbSqlite<Box<[u8]>>

source§

impl DerefPlusSelf for KvdbSqlite<Box<[u8]>>

§

type Target = KvdbSqlite<Box<[u8]>>

source§

fn deref(&self) -> &Self

source§

impl<ValueType: 'static + DbValueType + ValueRead + ValueReadImpl<<ValueType as ValueRead>::Kind>> KeyValueDbTraitTransactional for KvdbSqlite<ValueType>
where ValueType::Type: SqlBindableValue + BindValueAppendImpl<<ValueType::Type as SqlBindableValue>::Kind>,

§

type TransactionType = KvdbSqliteTransaction<ValueType>

source§

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>

§

type ValueType = ValueType

source§

impl<ValueType> MallocSizeOf for KvdbSqlite<ValueType>

source§

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>

source§

impl<ValueType> ReadImplFamily for KvdbSqlite<ValueType>

source§

impl<T: SingleWriterImplFamily<FamilyRepresentative = KvdbSqlite<ValueType>> + KvdbSqliteDestructureTrait + KeyValueDbTypes<ValueType = ValueType>, ValueType: DbValueType> SingleWriterImplByFamily<KvdbSqlite<ValueType>> for T
where ValueType::Type: SqlBindableValue + BindValueAppendImpl<<ValueType::Type as SqlBindableValue>::Kind>,

source§

fn delete_impl(&mut self, key: &[u8]) -> Result<Option<Option<Self::ValueType>>>

source§

fn delete_with_number_key_impl( &mut self, key: i64 ) -> Result<Option<Option<<Self as KeyValueDbTypes>::ValueType>>>

source§

fn put_impl( &mut self, key: &[u8], value: &<Self::ValueType as DbValueType>::Type ) -> Result<Option<Option<Self::ValueType>>>

source§

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>

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> ElementSatisfy<ElementNoConstrain> for T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> KeyValueDbAsAnyTrait for T
where T: KeyValueDbTypes + Any,

source§

fn as_any(&self) -> &(dyn Any + 'static)

source§

impl<T> KeyValueDbTraitTransactionalDyn for T

source§

fn start_transaction_dyn( &self, immediate_write: bool ) -> Result<Box<dyn KeyValueDbTransactionTrait<ValueType = <T as KeyValueDbTypes>::ValueType>>, Error>

source§

impl<T, ValueType> OwnedReadImplByFamily<KvdbSqlite<ValueType>> for T
where T: OwnedReadImplFamily<FamilyRepresentative = KvdbSqlite<ValueType>> + KvdbSqliteDestructureTrait + KeyValueDbTypes<ValueType = ValueType>, ValueType: DbValueType + ValueRead + ValueReadImpl<<ValueType as ValueRead>::Kind>,

source§

impl<T, ValueType> ReadImplByFamily<KvdbSqlite<ValueType>> for T
where T: ReadImplFamily<FamilyRepresentative = KvdbSqlite<ValueType>> + KvdbSqliteRefDestructureTrait + KeyValueDbTypes<ValueType = ValueType>, ValueType: DbValueType + ValueRead + ValueReadImpl<<ValueType as ValueRead>::Kind>,

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V