Struct KvdbSqliteSharded

Source
pub struct KvdbSqliteSharded<ValueType> { /* private fields */ }

Implementations§

Source§

impl<ValueType> KvdbSqliteSharded<ValueType>

Source

pub fn new( shard_connections: Option<Box<[SqliteConnection]>>, statements: Arc<KvdbSqliteStatements>, ) -> Self

Source

pub fn into_connections(self) -> Option<Box<[SqliteConnection]>>

Source§

impl<ValueType> KvdbSqliteSharded<ValueType>

Source

pub fn db_path<P: AsRef<Path>>(path: P, shard_id: u16) -> PathBuf

Source

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

Source

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

Source

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

Source

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

Source

pub fn create_table( connections: &mut Box<[SqliteConnection]>, statements: &KvdbSqliteStatements, ) -> Result<()>

Call initialize databases separately. Typical usage is to create a new table from the existing db.

Source

pub fn check_if_table_exist( connections: &mut Box<[SqliteConnection]>, statements: &KvdbSqliteStatements, ) -> Result<bool>

Source

pub fn drop_table( connections: &mut Box<[SqliteConnection]>, statements: &KvdbSqliteStatements, ) -> Result<()>

Source

pub fn vacumm_db( connections: &mut Box<[SqliteConnection]>, statements: &KvdbSqliteStatements, ) -> Result<()>

Trait Implementations§

Source§

impl DerefMutPlusSelf for KvdbSqliteSharded<()>

Source§

type Target = KvdbSqliteSharded<()>

Source§

fn deref_mut(&mut self) -> &mut Self

Source§

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

Source§

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

Source§

fn deref_mut(&mut self) -> &mut Self

Source§

impl DerefPlusSelf for KvdbSqliteSharded<()>

Source§

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

Source§

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

Source§

fn deref(&self) -> &Self

Source§

impl ElementSatisfy<dyn KeyValueDbIterableTrait<(Vec<u8>, ()), [u8], KvdbSqliteShardedIteratorTag>> for KvdbSqliteSharded<()>

Source§

fn to_constrain_object( &self, ) -> &(dyn KeyValueDbIterableTrait<(Vec<u8>, ()), [u8], KvdbSqliteShardedIteratorTag> + 'static)

Source§

fn to_constrain_object_mut( &mut self, ) -> &mut (dyn KeyValueDbIterableTrait<(Vec<u8>, ()), [u8], KvdbSqliteShardedIteratorTag> + 'static)

Source§

impl ElementSatisfy<dyn KeyValueDbIterableTrait<(Vec<u8>, Box<[u8]>), [u8], KvdbSqliteShardedIteratorTag>> for KvdbSqliteSharded<Box<[u8]>>

Source§

fn to_constrain_object( &self, ) -> &(dyn KeyValueDbIterableTrait<MptKeyValue, [u8], KvdbSqliteShardedIteratorTag> + 'static)

Source§

fn to_constrain_object_mut( &mut self, ) -> &mut (dyn KeyValueDbIterableTrait<MptKeyValue, [u8], KvdbSqliteShardedIteratorTag> + 'static)

Source§

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

Source§

type TransactionType = KvdbSqliteShardedTransaction<ValueType>

Source§

fn start_transaction( &self, immediate_write: bool, ) -> Result<KvdbSqliteShardedTransaction<ValueType>>

Immediate_write indicates whether the transaction should acquire a write-lock immediately if any.
Source§

impl<ValueType: DbValueType> KeyValueDbTypes for KvdbSqliteSharded<ValueType>

Source§

type ValueType = ValueType

Source§

impl<ValueType> MallocSizeOf for KvdbSqliteSharded<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 OwnedReadImplFamily for &KvdbSqliteSharded<Box<[u8]>>

Source§

impl<ValueType> OwnedReadImplFamily for KvdbSqliteSharded<ValueType>

Source§

impl<ValueType> ReadImplFamily for KvdbSqliteSharded<ValueType>

Source§

impl<ValueType> SingleWriterImplFamily for KvdbSqliteSharded<ValueType>

Source§

impl WrappedLifetimeFamily<'_, dyn KeyValueDbIterableTrait<(Vec<u8>, ()), [u8], KvdbSqliteShardedIteratorTag>> for KvdbSqliteSharded<()>

Source§

impl WrappedLifetimeFamily<'_, dyn KeyValueDbIterableTrait<(Vec<u8>, Box<[u8]>), [u8], KvdbSqliteShardedIteratorTag>> for KvdbSqliteSharded<Box<[u8]>>

Source§

impl DeltaDbTrait for KvdbSqliteSharded<Box<[u8]>>

Source§

impl KeyValueDbTraitMultiReader for KvdbSqliteSharded<Box<[u8]>>

Source§

impl WrappedTrait<dyn KeyValueDbIterableTrait<(Vec<u8>, ()), [u8], KvdbSqliteShardedIteratorTag>> for KvdbSqliteSharded<()>

Source§

impl WrappedTrait<dyn KeyValueDbIterableTrait<(Vec<u8>, Box<[u8]>), [u8], KvdbSqliteShardedIteratorTag>> for KvdbSqliteSharded<Box<[u8]>>

Auto Trait Implementations§

§

impl<ValueType> Freeze for KvdbSqliteSharded<ValueType>

§

impl<ValueType> !RefUnwindSafe for KvdbSqliteSharded<ValueType>

§

impl<ValueType> Send for KvdbSqliteSharded<ValueType>
where ValueType: Send,

§

impl<ValueType> Sync for KvdbSqliteSharded<ValueType>
where ValueType: Sync,

§

impl<ValueType> Unpin for KvdbSqliteSharded<ValueType>
where ValueType: Unpin,

§

impl<ValueType> !UnwindSafe for KvdbSqliteSharded<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> KeyValueDbToOwnedReadTrait for T
where T: 'static + KeyValueDbTraitMultiReader, &'a T: for<'a> KeyValueDbTraitOwnedRead<ValueType = <T as KeyValueDbTypes>::ValueType>,

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<KvdbSqliteSharded<ValueType>> for T
where T: OwnedReadImplFamily + KvdbSqliteShardedDestructureTrait + KeyValueDbTypes<ValueType = ValueType>, ValueType: DbValueType + ValueRead + ValueReadImpl<<ValueType as ValueRead>::Kind>,

Source§

impl<T, ValueType> ReadImplByFamily<KvdbSqliteSharded<ValueType>> for T
where T: ReadImplFamily + KvdbSqliteShardedRefDestructureTrait + KeyValueDbTypes<ValueType = ValueType>, ValueType: DbValueType + ValueRead + ValueReadImpl<<ValueType as ValueRead>::Kind>,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

Source§

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>,

Source§

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