Skip to main content

StaticConfig

Struct StaticConfig 

Source
pub struct StaticConfig { /* private fields */ }
Expand description

Persistent L2 geometry and fixed-index sizing.

These values define the static disk identity. A clean image created with a different static configuration is discarded and the cache starts empty.

Implementations§

Source§

impl StaticConfig

Source

pub fn new(capacity_bytes: u64) -> Self

Creates static L2 geometry and sizes its index assuming an average 16 KiB live entry.

capacity_bytes is the total Region extent, excluding the data superblock, state, and clean-image files. The default Region size is 32 MiB. A default plan above 4 TiB exceeds the supported index size and fails validation; use Self::with_expected_entries when a larger average entry permits a smaller explicit index. Use Self::peak_disk_bytes for the cache-owned logical disk bound.

Source

pub fn with_region_size_bytes(self, bytes: u64) -> Self

Sets the Region size in bytes.

Valid sizes are 4 KiB multiples through 32 MiB. L2 capacity is an exact multiple containing at least two Regions. A complete encoded record fits in one Region. Every append shard eagerly owns two Region-sized staging buffers.

Source

pub fn with_expected_entries(self, entries: usize) -> Self

Sizes the fixed L2 index for the expected number of simultaneously live keys.

This counts simultaneously live keys. The resulting index uses roughly two physical buckets per expected live key and is part of the static disk identity.

Source

pub const fn capacity_bytes(&self) -> u64

Returns the total Region extent in bytes.

Source

pub const fn region_size_bytes(&self) -> u64

Returns the Region size in bytes.

Source

pub const fn index_slots(&self) -> usize

Returns the fixed number of physical L2 index slots.

Source

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

Validates the static physical geometry before opening cache files.

Source

pub fn peak_disk_bytes(&self) -> Result<u64>

Maximum cache-owned logical disk bytes after a successful open.

The bound includes the fixed data and state files plus both the current clean image and the temporary image used for atomic warm publication. Filesystem metadata and block-allocation granularity are outside it.

Trait Implementations§

Source§

impl Clone for StaticConfig

Source§

fn clone(&self) -> StaticConfig

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 Debug for StaticConfig

Source§

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

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

impl Eq for StaticConfig

Source§

impl PartialEq for StaticConfig

Source§

fn eq(&self, other: &StaticConfig) -> 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 StaticConfig

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> 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<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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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.