Skip to main content

StoreConfig

Struct StoreConfig 

Source
pub struct StoreConfig {
    pub writer: WriterArm,
    pub index: IndexArm,
    pub gc: GcArm,
    pub redb_cache_bytes: usize,
}
Expand description

One implementation of each trait, chosen.

A plain Copy value with no interior state: it is read once, at construction, and from then on the store holds the built objects rather than this. Handing it around after that is a description of what was built, not a switch anything consults.

Fields§

§writer: WriterArm§index: IndexArm§gc: GcArm§redb_cache_bytes: usize

The redb page-cache ceiling the store’s two databases are opened under. Not an arm — it selects nothing — but it is part of what was built, and a Display of the config that left it out would have hidden the one key that was “falsified” on 2026-08-11 by never reaching the container at all. StoreConfig::from_env fills it from redb_cache_bytes; DEFAULT is DEFAULT_REDB_CACHE_BYTES.

Implementations§

Source§

impl StoreConfig

Source

pub const DEFAULT: StoreConfig

What shipped before this module existed, and what still ships.

SafeWriter + ObjectReadStack<OneTableFourColumns> + NewGeneration. GitStore::open builds exactly this and consults no environment to do it.

Source

pub fn from_env() -> Result<Self>

Read the three arms and the cache ceiling. Four getenvs, once, here.

It is called from a store’s constructor and from nowhere on a serving path; env_reads is what makes that assertable rather than asserted- by-comment. An unset or empty variable takes the default; a variable set to an unknown value is an error rather than a silent fallback, so a typo cannot make a measurement look like it came from an arm that never ran.

The ceiling rides along because it is read on the same construction path and printed by the same Display: a caller that logs from_env()’s result once at store open has then logged every per-store variable this crate consults, and ZNIPPY_GIT_REDB_CACHE_BYTES is no longer the one that can be set on a host, stop at a container boundary, and leave no trace of having done so.

Source

pub fn with_writer(self, w: WriterArm) -> Self

Same three arms with a different writer. For a bench that sweeps one axis.

Source

pub fn with_index(self, i: IndexArm) -> Self

Source

pub fn with_gc(self, g: GcArm) -> Self

Source

pub fn with_redb_cache_bytes(self, bytes: usize) -> Self

Same arms, a different redb page-cache ceiling. What GitStore::open uses to put the environment’s ceiling on the default arms without reading any arm.

Trait Implementations§

Source§

impl Clone for StoreConfig

Source§

fn clone(&self) -> StoreConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for StoreConfig

Source§

impl Debug for StoreConfig

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for StoreConfig

Source§

fn default() -> Self

StoreConfig::DEFAULT, spelled out. A derived Default would put a zero-byte page cache on the shipping combination.

Source§

impl Display for StoreConfig

KEY=value for every per-store variable, in the spelling an operator would type — so one log line at store open is a complete, reproducible statement of what the environment selected, including the ceiling.

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for StoreConfig

Source§

impl PartialEq for StoreConfig

Source§

fn eq(&self, other: &StoreConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StoreConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.