pub struct Config {
pub max_summary_branches: usize,
pub max_key_branches: usize,
pub max_leaf_count: usize,
pub target_leaf_size: usize,
pub max_uncompressed_leaf_size: usize,
pub zstd_level: i32,
}
Expand description
Configuration for a forest. Includes settings for when a node is considered full
Fields§
§max_summary_branches: usize
maximum number of children in a level>1 branch that contains summaries
max_key_branches: usize
maximum number of children in a level 1 branch that contains key sequences
max_leaf_count: usize
maximum number of values in a level 0 leaf that contains value sequences
target_leaf_size: usize
rough maximum compressed bytes of a leaf. If a node has more bytes than this, it is considered full.
note that this might overshoot due to the fact that the zstd encoder has internal state, and it is not possible to flush after each value without losing compression efficiency. The overshoot is bounded though.
max_uncompressed_leaf_size: usize
Maximum uncompressed size of leafs. This is limited to prevent accidentally creating decompression bombs.
zstd_level: i32
zstd level to use for compression
Implementations§
source§impl Config
impl Config
sourcepub fn debug() -> Self
pub fn debug() -> Self
config that will produce complex tree structures with few values
keys are hardcoded to 0
sourcepub fn debug_fast() -> Self
pub fn debug_fast() -> Self
config that will produce efficient trees
sourcepub fn branch_sealed<T: TreeTypes>(
&self,
items: &[Index<T>],
level: u32
) -> bool
pub fn branch_sealed<T: TreeTypes>( &self, items: &[Index<T>], level: u32 ) -> bool
predicate to determine if a branch is sealed, based on the config