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: usizeThe 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
impl StoreConfig
Sourcepub const DEFAULT: StoreConfig
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.
Sourcepub fn from_env() -> Result<Self>
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.
Sourcepub fn with_writer(self, w: WriterArm) -> Self
pub fn with_writer(self, w: WriterArm) -> Self
Same three arms with a different writer. For a bench that sweeps one axis.
pub fn with_index(self, i: IndexArm) -> Self
pub fn with_gc(self, g: GcArm) -> Self
Sourcepub fn with_redb_cache_bytes(self, bytes: usize) -> Self
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
impl Clone for StoreConfig
Source§fn clone(&self) -> StoreConfig
fn clone(&self) -> StoreConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StoreConfig
Source§impl Debug for StoreConfig
impl Debug for StoreConfig
Source§impl Default for StoreConfig
impl Default for StoreConfig
Source§fn default() -> Self
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.
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.
impl Eq for StoreConfig
Source§impl PartialEq for StoreConfig
impl PartialEq for StoreConfig
impl StructuralPartialEq for StoreConfig
Auto Trait Implementations§
impl Freeze for StoreConfig
impl RefUnwindSafe for StoreConfig
impl Send for StoreConfig
impl Sync for StoreConfig
impl Unpin for StoreConfig
impl UnsafeUnpin for StoreConfig
impl UnwindSafe for StoreConfig
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.