Struct RuntimeSetup
pub struct RuntimeSetup { /* private fields */ }Expand description
Programmatic runtime setup that mirrors selected SOF environment variables.
This lets embedders configure startup in code while keeping SOF’s env-based configuration model for everything else.
Implementations§
§impl RuntimeSetup
impl RuntimeSetup
pub const fn new() -> Self
pub const fn new() -> Self
Creates an empty setup that preserves standard env/default behavior.
pub fn with_env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Adds an explicit env-style override.
pub fn with_rust_log_filter(self, filter: impl Into<String>) -> Self
pub fn with_rust_log_filter(self, filter: impl Into<String>) -> Self
Sets RUST_LOG.
pub fn with_bind_addr(self, bind_addr: SocketAddr) -> Self
pub fn with_bind_addr(self, bind_addr: SocketAddr) -> Self
Sets SOF_BIND.
pub fn with_gossip_entrypoints<I, S>(self, gossip_entrypoints: I) -> Self
pub fn with_gossip_entrypoints<I, S>(self, gossip_entrypoints: I) -> Self
Sets SOF_GOSSIP_ENTRYPOINT from a list of entrypoints.
pub fn with_gossip_validators<I, S>(self, gossip_validators: I) -> Self
pub fn with_gossip_validators<I, S>(self, gossip_validators: I) -> Self
Sets SOF_GOSSIP_VALIDATORS from a list of validator identity pubkeys.
pub fn with_gossip_port_range(self, start: u16, end: u16) -> Self
pub fn with_gossip_port_range(self, start: u16, end: u16) -> Self
Sets SOF_PORT_RANGE.
pub fn with_shred_version(self, shred_version: u16) -> Self
pub fn with_shred_version(self, shred_version: u16) -> Self
Sets SOF_SHRED_VERSION.
pub fn with_startup_step_logs(self, enabled: bool) -> Self
pub fn with_startup_step_logs(self, enabled: bool) -> Self
Sets SOF_LOG_STARTUP_STEPS.
pub fn with_repair_peer_traffic_logs(self, enabled: bool) -> Self
pub fn with_repair_peer_traffic_logs(self, enabled: bool) -> Self
Sets SOF_LOG_REPAIR_PEER_TRAFFIC.
pub fn with_repair_peer_traffic_every(self, every_n_events: u64) -> Self
pub fn with_repair_peer_traffic_every(self, every_n_events: u64) -> Self
Sets SOF_LOG_REPAIR_PEER_TRAFFIC_EVERY.
pub fn with_worker_threads(self, worker_threads: usize) -> Self
pub fn with_worker_threads(self, worker_threads: usize) -> Self
Sets SOF_WORKER_THREADS.
pub fn with_dataset_workers(self, dataset_workers: usize) -> Self
pub fn with_dataset_workers(self, dataset_workers: usize) -> Self
Sets SOF_DATASET_WORKERS.
pub fn with_dataset_max_tracked_slots(self, max_tracked_slots: usize) -> Self
pub fn with_dataset_max_tracked_slots(self, max_tracked_slots: usize) -> Self
Sets SOF_DATASET_MAX_TRACKED_SLOTS.
pub fn with_dataset_queue_capacity(self, queue_capacity: usize) -> Self
pub fn with_dataset_queue_capacity(self, queue_capacity: usize) -> Self
Sets SOF_DATASET_QUEUE_CAPACITY.
pub fn with_fec_max_tracked_sets(self, max_tracked_sets: usize) -> Self
pub fn with_fec_max_tracked_sets(self, max_tracked_sets: usize) -> Self
Sets SOF_FEC_MAX_TRACKED_SETS.
pub fn with_log_all_txs(self, enabled: bool) -> Self
pub fn with_log_all_txs(self, enabled: bool) -> Self
Sets SOF_LOG_ALL_TXS.
pub fn with_log_non_vote_txs(self, enabled: bool) -> Self
pub fn with_log_non_vote_txs(self, enabled: bool) -> Self
Sets SOF_LOG_NON_VOTE_TXS.
pub fn with_log_dataset_reconstruction(self, enabled: bool) -> Self
pub fn with_log_dataset_reconstruction(self, enabled: bool) -> Self
Sets SOF_LOG_DATASET_RECONSTRUCTION.
pub fn with_derived_state_checkpoint_interval_ms(self, interval_ms: u64) -> Self
pub fn with_derived_state_checkpoint_interval_ms(self, interval_ms: u64) -> Self
Sets SOF_DERIVED_STATE_CHECKPOINT_INTERVAL_MS.
Use 0 to disable periodic checkpoint barriers.
pub fn with_derived_state_recovery_interval_ms(self, interval_ms: u64) -> Self
pub fn with_derived_state_recovery_interval_ms(self, interval_ms: u64) -> Self
Sets SOF_DERIVED_STATE_RECOVERY_INTERVAL_MS.
Use 0 to disable periodic replay-based recovery attempts for unhealthy consumers.
pub fn with_derived_state_replay_max_envelopes(
self,
max_envelopes: usize,
) -> Self
pub fn with_derived_state_replay_max_envelopes( self, max_envelopes: usize, ) -> Self
Sets SOF_DERIVED_STATE_REPLAY_MAX_ENVELOPES.
Use 0 to disable the runtime-owned retained replay tail.
pub fn with_derived_state_replay_max_sessions(self, max_sessions: usize) -> Self
pub fn with_derived_state_replay_max_sessions(self, max_sessions: usize) -> Self
Sets SOF_DERIVED_STATE_REPLAY_MAX_SESSIONS.
Used by the disk backend to compact older session logs.
pub fn with_derived_state_config(
self,
config: DerivedStateRuntimeConfig,
) -> Self
pub fn with_derived_state_config( self, config: DerivedStateRuntimeConfig, ) -> Self
Applies one typed derived-state configuration bundle.
pub fn with_derived_state_replay_backend(
self,
backend: DerivedStateReplayBackend,
) -> Self
pub fn with_derived_state_replay_backend( self, backend: DerivedStateReplayBackend, ) -> Self
Sets SOF_DERIVED_STATE_REPLAY_BACKEND.
pub fn with_derived_state_replay_dir(
self,
replay_dir: impl Into<PathBuf>,
) -> Self
pub fn with_derived_state_replay_dir( self, replay_dir: impl Into<PathBuf>, ) -> Self
Sets SOF_DERIVED_STATE_REPLAY_DIR.
pub fn with_derived_state_replay_durability(
self,
durability: DerivedStateReplayDurability,
) -> Self
pub fn with_derived_state_replay_durability( self, durability: DerivedStateReplayDurability, ) -> Self
Sets SOF_DERIVED_STATE_REPLAY_DURABILITY.
pub fn with_live_shreds_enabled(self, enabled: bool) -> Self
pub fn with_live_shreds_enabled(self, enabled: bool) -> Self
Sets SOF_LIVE_SHREDS_ENABLED.
When false, runtime keeps control-plane hooks active but skips live
shred data-plane processing (on_raw_packet, on_shred, datasets, txs).
pub fn with_verify_shreds(self, enabled: bool) -> Self
pub fn with_verify_shreds(self, enabled: bool) -> Self
Sets SOF_VERIFY_SHREDS.
pub fn with_verify_strict_unknown(self, enabled: bool) -> Self
pub fn with_verify_strict_unknown(self, enabled: bool) -> Self
Sets SOF_VERIFY_STRICT.
pub fn with_verify_recovered_shreds(self, enabled: bool) -> Self
pub fn with_verify_recovered_shreds(self, enabled: bool) -> Self
Sets SOF_VERIFY_RECOVERED_SHREDS.
pub fn with_verify_slot_window(self, slot_window: u64) -> Self
pub fn with_verify_slot_window(self, slot_window: u64) -> Self
Sets SOF_VERIFY_SLOT_WINDOW.
pub fn with_verify_signature_cache_entries(self, entries: usize) -> Self
pub fn with_verify_signature_cache_entries(self, entries: usize) -> Self
Sets SOF_VERIFY_SIGNATURE_CACHE.
pub fn with_shred_dedupe_capacity(self, dedupe_capacity: usize) -> Self
pub fn with_shred_dedupe_capacity(self, dedupe_capacity: usize) -> Self
Sets SOF_SHRED_DEDUP_CAPACITY.
pub fn with_shred_dedupe_ttl_ms(self, dedupe_ttl_ms: u64) -> Self
pub fn with_shred_dedupe_ttl_ms(self, dedupe_ttl_ms: u64) -> Self
Sets SOF_SHRED_DEDUP_TTL_MS.
pub fn with_udp_receiver_core(self, core_index: usize) -> Self
pub fn with_udp_receiver_core(self, core_index: usize) -> Self
Sets SOF_UDP_RECEIVER_CORE.
pub fn with_udp_rcvbuf_bytes(self, rcvbuf_bytes: usize) -> Self
pub fn with_udp_rcvbuf_bytes(self, rcvbuf_bytes: usize) -> Self
Sets SOF_UDP_RCVBUF.
pub fn with_udp_batch_size(self, batch_size: usize) -> Self
pub fn with_udp_batch_size(self, batch_size: usize) -> Self
Sets SOF_UDP_BATCH_SIZE.
pub fn with_udp_batch_max_wait_ms(self, batch_max_wait_ms: u64) -> Self
pub fn with_udp_batch_max_wait_ms(self, batch_max_wait_ms: u64) -> Self
Sets SOF_UDP_BATCH_MAX_WAIT_MS.
pub fn with_udp_idle_wait_ms(self, idle_wait_ms: u64) -> Self
pub fn with_udp_idle_wait_ms(self, idle_wait_ms: u64) -> Self
Sets SOF_UDP_IDLE_WAIT_MS.
pub fn with_ingest_queue_mode(self, mode: impl Into<String>) -> Self
pub fn with_ingest_queue_mode(self, mode: impl Into<String>) -> Self
Sets SOF_INGEST_QUEUE_MODE.
Accepted values:
bounded(default): Tokio bounded channel.unbounded: Tokio unbounded channel.lockfree: lock-freeArrayQueuering with async wakeups.
pub fn with_ingest_queue_capacity(self, queue_capacity: usize) -> Self
pub fn with_ingest_queue_capacity(self, queue_capacity: usize) -> Self
Sets SOF_INGEST_QUEUE_CAPACITY.
Used by bounded and lockfree modes.
pub fn with_repair_enabled(self, enabled: bool) -> Self
pub fn with_repair_enabled(self, enabled: bool) -> Self
Sets SOF_REPAIR_ENABLED.
pub fn with_repair_tick_ms(self, repair_tick_ms: u64) -> Self
pub fn with_repair_tick_ms(self, repair_tick_ms: u64) -> Self
Sets SOF_REPAIR_TICK_MS.
pub fn with_repair_slot_window(self, repair_slot_window: u64) -> Self
pub fn with_repair_slot_window(self, repair_slot_window: u64) -> Self
Sets SOF_REPAIR_SLOT_WINDOW.
pub fn with_repair_peer_sample_size(self, peer_sample_size: usize) -> Self
pub fn with_repair_peer_sample_size(self, peer_sample_size: usize) -> Self
Sets SOF_REPAIR_PEER_SAMPLE_SIZE.
pub fn with_repair_serve_max_bytes_per_sec(self, bytes_per_sec: usize) -> Self
pub fn with_repair_serve_max_bytes_per_sec(self, bytes_per_sec: usize) -> Self
Sets SOF_REPAIR_SERVE_MAX_BYTES_PER_SEC.
pub fn with_repair_serve_unstaked_max_bytes_per_sec(
self,
bytes_per_sec: usize,
) -> Self
pub fn with_repair_serve_unstaked_max_bytes_per_sec( self, bytes_per_sec: usize, ) -> Self
Sets SOF_REPAIR_SERVE_UNSTAKED_MAX_BYTES_PER_SEC.
pub fn with_repair_serve_max_requests_per_peer_per_sec(
self,
requests_per_sec: usize,
) -> Self
pub fn with_repair_serve_max_requests_per_peer_per_sec( self, requests_per_sec: usize, ) -> Self
Sets SOF_REPAIR_SERVE_MAX_REQUESTS_PER_PEER_PER_SEC.
pub fn with_repair_max_requests_per_tick(
self,
max_requests_per_tick: usize,
) -> Self
pub fn with_repair_max_requests_per_tick( self, max_requests_per_tick: usize, ) -> Self
Sets SOF_REPAIR_MAX_REQUESTS_PER_TICK.
pub fn with_repair_tip_stall_ms(self, tip_stall_ms: u64) -> Self
pub fn with_repair_tip_stall_ms(self, tip_stall_ms: u64) -> Self
Sets SOF_REPAIR_TIP_STALL_MS.
pub fn with_repair_dataset_stall_ms(self, dataset_stall_ms: u64) -> Self
pub fn with_repair_dataset_stall_ms(self, dataset_stall_ms: u64) -> Self
Sets SOF_REPAIR_DATASET_STALL_MS.
pub fn with_repair_stall_sustain_ms(self, stall_sustain_ms: u64) -> Self
pub fn with_repair_stall_sustain_ms(self, stall_sustain_ms: u64) -> Self
Sets SOF_REPAIR_STALL_SUSTAIN_MS.
pub fn with_gossip_runtime_switch_enabled(self, enabled: bool) -> Self
pub fn with_gossip_runtime_switch_enabled(self, enabled: bool) -> Self
Sets SOF_GOSSIP_RUNTIME_SWITCH_ENABLED.
pub fn with_gossip_runtime_switch_stall_ms(self, switch_stall_ms: u64) -> Self
pub fn with_gossip_runtime_switch_stall_ms(self, switch_stall_ms: u64) -> Self
Sets SOF_GOSSIP_RUNTIME_SWITCH_STALL_MS.
pub fn with_gossip_runtime_switch_dataset_stall_ms(
self,
switch_dataset_stall_ms: u64,
) -> Self
pub fn with_gossip_runtime_switch_dataset_stall_ms( self, switch_dataset_stall_ms: u64, ) -> Self
Sets SOF_GOSSIP_RUNTIME_SWITCH_DATASET_STALL_MS.
pub fn with_gossip_runtime_switch_cooldown_ms(
self,
switch_cooldown_ms: u64,
) -> Self
pub fn with_gossip_runtime_switch_cooldown_ms( self, switch_cooldown_ms: u64, ) -> Self
Sets SOF_GOSSIP_RUNTIME_SWITCH_COOLDOWN_MS.
pub fn with_gossip_runtime_switch_warmup_ms(self, switch_warmup_ms: u64) -> Self
pub fn with_gossip_runtime_switch_warmup_ms(self, switch_warmup_ms: u64) -> Self
Sets SOF_GOSSIP_RUNTIME_SWITCH_WARMUP_MS.
Trait Implementations§
§impl Clone for RuntimeSetup
impl Clone for RuntimeSetup
§fn clone(&self) -> RuntimeSetup
fn clone(&self) -> RuntimeSetup
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for RuntimeSetup
impl Debug for RuntimeSetup
§impl Default for RuntimeSetup
impl Default for RuntimeSetup
§fn default() -> RuntimeSetup
fn default() -> RuntimeSetup
Auto Trait Implementations§
impl Freeze for RuntimeSetup
impl RefUnwindSafe for RuntimeSetup
impl Send for RuntimeSetup
impl Sync for RuntimeSetup
impl Unpin for RuntimeSetup
impl UnsafeUnpin for RuntimeSetup
impl UnwindSafe for RuntimeSetup
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more