Skip to main content

RuntimeOptions

Struct RuntimeOptions 

Source
#[non_exhaustive]
pub struct RuntimeOptions {
Show 13 fields pub io_engine: IoEngineOptions, pub io_mode: IoMode, pub read_admission: ReadAdmission, pub reclaim_io_timeout: Duration, pub io_recovery_timeout: Option<Duration>, pub fill_control: FillControlOptions, pub append_shards: u32, pub l1_capacity_bytes: usize, pub l1_eviction_policy: L1EvictionPolicy, pub managed_memory_limit_bytes: usize, pub l1_shards: usize, pub write_flush_threshold_bytes: usize, pub stats: StatsOptions,
}
Expand description

Process-local runtime configuration checked together by CacheConfig::new.

These options may change across opens. Warm recovery rebinds append shards from recovered Active and Free Regions when the requested topology fits. Start with Self::default and assign the fields to customize.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§io_engine: IoEngineOptions

Independent read, write, and reclaim pools (defaults to POSIX with 4, 4, and 1 workers).

§io_mode: IoMode

Record I/O mode (defaults to buffered; direct I/O requires supported Linux storage).

§read_admission: ReadAdmission

Admission policy after an L2 candidate has been selected.

§reclaim_io_timeout: Duration

Deadline for each background reclaim read, including I/O admission.

Defaults to five seconds. Must be positive and representable as an absolute deadline. Does not change foreground reads or writes. Longer deadlines can delay shutdown and exhaust free Regions while waiting; expiration enters io_recovery_timeout recovery before cancellation can fail the cache instance.

§io_recovery_timeout: Option<Duration>

Background timeout recovery budget after the normal admission/completion deadline.

Defaults to None (recover until completion or close). Use Some(Duration::ZERO) for immediate cancellation, or a finite duration to limit recovery. While recovering, new fills return overload while existing reads and deletes remain available; original requests retain their slots, buffers, and Regions and are never resubmitted. Close interrupts recovery, whereas drain can wait indefinitely with None. Actual I/O errors and invalid completions still fail the instance.

§fill_control: FillControlOptions

Optional pre-timeout fill pressure control.

Disabled by default. Enabled modes reserve bounded worker observations; Adaptive paces background flush and pauses new fills when outstanding work is old.

§append_shards: u32

Hash-routed append paths, from 1 through 256 (default 4).

Each shard needs one Active Region, two Region-sized buffers, and a worker; the layout also needs one spare Region.

§l1_capacity_bytes: usize

Retained L1 byte budget, including keys, values, and ownership charges.

Defaults to 256 MiB; zero disables L1. Fixed L1 metadata is charged separately.

§l1_eviction_policy: L1EvictionPolicy

Bounded L1 eviction policy (defaults to CLOCK; S3-FIFO adds ghost metadata).

§managed_memory_limit_bytes: usize

Aggregate cache-managed memory limit, defaulting to 1 GiB.

Covers index mappings, L1, buffers, metadata, queues, and cache threads. Allocator overhead, Tokio, application memory, and the kernel page cache are outside it.

§l1_shards: usize

Independently locked L1 shards, from 1 through 65536 (default 32).

Powers of two give the cheapest routing; more shards require more metadata.

§write_flush_threshold_bytes: usize

Per-append-shard threshold for requesting a flush, in 4 KiB multiples through 4 MiB (the default).

Partial buffers also flush on a bounded delay, pressure, and completion barriers.

§stats: StatsOptions

Activity counters, request outcomes, and latency distributions.

Defaults disable collection; health and resource gauges remain available.

Trait Implementations§

Source§

impl Clone for RuntimeOptions

Source§

fn clone(&self) -> Self

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 RuntimeOptions

Source§

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

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

impl Default for RuntimeOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for RuntimeOptions

Source§

impl PartialEq for RuntimeOptions

Source§

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

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<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> 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, !>

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.