#[non_exhaustive]pub struct RuntimeConfig {
pub modules_dir: PathBuf,
pub allow_private_egress: bool,
pub memory_budget_bytes: usize,
pub max_in_flight_per_tenant: usize,
pub max_output_bytes: usize,
pub component_cache_entries: usize,
pub component_cache_bytes: usize,
pub compile_concurrency: usize,
}Expand description
Configuration for a Runtime. Build with RuntimeConfig::new and
adjust the public fields; new fields may be added in minor releases.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.modules_dir: PathBufRoot of the module registry. Created if missing.
§Trust
Everything under modules_dir/cwasm is deserialized as native
machine code and executed. Anyone who can write there can run
arbitrary code as the host process, so the directory (and its
parents) must be writable only by the host process and trusted
operators, never by tenants or shared with less-trusted services.
allow_private_egress: boolLet guests’ http-out reach loopback/private/link-local addresses.
One flag drives both the DNS resolver filter and the IP-literal check.
Default false; enable only for local development and tests.
memory_budget_bytes: usizeTotal guest memory admitted concurrently, in bytes (default 1 GiB).
Each invocation weighs its Limits::mem_cap_bytes rounded up to whole
MiB; when the running total would exceed this, the invocation fails
fast with InvokeError::Overloaded. At least 1 MiB.
max_in_flight_per_tenant: usizeInvocations one tenant may have in flight (default 32); beyond that
InvokeError::TenantBusy. At least 1.
max_output_bytes: usizeLargest output an invocation may return, bytes (default 8 MiB).
component_cache_entries: usizeComponents kept loaded in memory (default 256). At least 1.
component_cache_bytes: usizeSerialized bytes of loaded components kept in memory (default 512 MiB).
compile_concurrency: usizeConcurrent compilations in Runtime::stage (default half the cores,
at least 1).
Implementations§
Trait Implementations§
Source§impl Clone for RuntimeConfig
impl Clone for RuntimeConfig
Auto Trait Implementations§
impl Freeze for RuntimeConfig
impl RefUnwindSafe for RuntimeConfig
impl Send for RuntimeConfig
impl Sync for RuntimeConfig
impl Unpin for RuntimeConfig
impl UnsafeUnpin for RuntimeConfig
impl UnwindSafe for RuntimeConfig
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
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<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