pub struct TableBucketBuilder { /* private fields */ }Expand description
Builder for table bucket configuration and name resolution.
Implementations§
Source§impl TableBucketBuilder
impl TableBucketBuilder
Sourcepub fn new(
bucket_size: u64,
table_prefix: impl Into<String>,
) -> Result<Self, BucketError>
pub fn new( bucket_size: u64, table_prefix: impl Into<String>, ) -> Result<Self, BucketError>
Create a new builder with the specified bucket size and table prefix.
§Arguments
bucket_size- Size of each bucket for integer division (must be > 0)table_prefix- Prefix for bucket table names
Sourcepub fn bucket_size(&self) -> u64
pub fn bucket_size(&self) -> u64
Get the configured bucket size.
Sourcepub fn table_prefix(&self) -> &str
pub fn table_prefix(&self) -> &str
Get the configured table prefix.
Sourcepub fn bucket_for_sequence(&self, sequence: u64) -> u64
pub fn bucket_for_sequence(&self, sequence: u64) -> u64
Compute the bucket for the given sequence.
Sourcepub fn bucket_table_name(&self, bucket: u64) -> &'static str
pub fn bucket_table_name(&self, bucket: u64) -> &'static str
Resolve the bucket table name, caching and leaking the name string.
Sourcepub fn table_definition<K: Key + 'static, V: Value + 'static>(
&self,
bucket: u64,
) -> TableDefinition<'static, K, V>
pub fn table_definition<K: Key + 'static, V: Value + 'static>( &self, bucket: u64, ) -> TableDefinition<'static, K, V>
Create a table definition for the given bucket.
Sourcepub fn multimap_table_definition<K: Key + 'static, V: Key + 'static>(
&self,
bucket: u64,
) -> MultimapTableDefinition<'static, K, V>
pub fn multimap_table_definition<K: Key + 'static, V: Key + 'static>( &self, bucket: u64, ) -> MultimapTableDefinition<'static, K, V>
Create a multimap table definition for the given bucket.
Sourcepub fn merge<K, V>(
&self,
txn: &mut WriteTransaction,
target: TableDefinition<'static, K, V>,
start_bucket: u64,
end_bucket: u64,
) -> Result<(), BucketError>
pub fn merge<K, V>( &self, txn: &mut WriteTransaction, target: TableDefinition<'static, K, V>, start_bucket: u64, end_bucket: u64, ) -> Result<(), BucketError>
Merge bucket tables into a single non-bucketed target table and delete the originals.
Sourcepub fn merge_all<K, V>(
&self,
txn: &mut WriteTransaction,
target: TableDefinition<'static, K, V>,
) -> Result<(), BucketError>
pub fn merge_all<K, V>( &self, txn: &mut WriteTransaction, target: TableDefinition<'static, K, V>, ) -> Result<(), BucketError>
Merge all bucket tables discovered in the database into the target table.
Trait Implementations§
Source§impl Clone for TableBucketBuilder
impl Clone for TableBucketBuilder
Source§fn clone(&self) -> TableBucketBuilder
fn clone(&self) -> TableBucketBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TableBucketBuilder
impl RefUnwindSafe for TableBucketBuilder
impl Send for TableBucketBuilder
impl Sync for TableBucketBuilder
impl Unpin for TableBucketBuilder
impl UnwindSafe for TableBucketBuilder
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