Struct ax_banyan::Config

source ·
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

source

pub fn debug() -> Self

config that will produce complex tree structures with few values

keys are hardcoded to 0

source

pub fn debug_fast() -> Self

config that will produce efficient trees

source

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

source

pub fn validate(&self) -> Result<()>

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Config

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>
where R: Read, E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more