pub struct LoadOptions {
pub isolation: Isolation,
pub init_deadline_ms: u64,
pub request_deadline_ms: u64,
pub max_memory_bytes: u64,
pub trusted_pool_size: usize,
pub checkout_timeout_ms: u64,
pub max_requests_per_instance: u64,
pub ratelimit_bucket: Option<Bucket>,
pub config: BTreeMap<String, String>,
}Expand description
Options for Host::load. A struct (not a bare arg) because deny-by-default grows more
load-time knobs onto it. Defaults to the safe side: Untrusted (fail-closed) with
metering on (ADR 000006). A future declarative manifest (ADR 000007) injects these.
Not Copy: the outbound policy (ADR 000036) carries an allowlist Vec, so this moves/clones.
Fields§
§isolation: Isolation§init_deadline_ms: u64Epoch deadline (ms) for the once-per-instance init export.
request_deadline_ms: u64Epoch deadline (ms) for each per-request hook (on-request / on-response).
max_memory_bytes: u64Per-instance linear-memory cap (bytes), enforced by a StoreLimits.
trusted_pool_size: usizeTrusted pool: maximum concurrent reusable instances (lazily filled, ADR 000012).
Clamped to [1, TRUSTED_POOL_MAX] at load. Ignored for Untrusted (fresh-per-request).
checkout_timeout_ms: u64Trusted pool: bounded wait (ms) for a free instance under saturation before failing
closed (RunError::Unavailable). Ignored for Untrusted.
max_requests_per_instance: u64Trusted pool: recycle an instance (discard + rebuild) after this many requests, bounding
linear-memory state accumulation (§6.6). Ignored for Untrusted.
ratelimit_bucket: Option<Bucket>This filter’s host-side token-bucket spec for host-ratelimit (manifest
[filter.ratelimit], ADR 000026). None = the filter has no limiter (its try-acquire
fails closed). Host-configured so an untrusted filter cannot override its own limit.
config: BTreeMap<String, String>This filter’s business config (manifest [filter.config], ADR 000066): an arbitrary
string→string map read back via host-config::get. The host never interprets keys or
values. Empty (the default) when the manifest declares no [filter.config] section — every
get then reads None, same as an undeclared key in a non-empty map.
Implementations§
Source§impl LoadOptions
impl LoadOptions
pub fn trusted() -> Self
pub fn untrusted() -> Self
Sourcepub fn with_request_deadline_ms(self, ms: u64) -> Self
pub fn with_request_deadline_ms(self, ms: u64) -> Self
Override the per-request hook deadline (ms).
Sourcepub fn with_init_deadline_ms(self, ms: u64) -> Self
pub fn with_init_deadline_ms(self, ms: u64) -> Self
Override the init deadline (ms).
Sourcepub fn with_max_memory_bytes(self, bytes: u64) -> Self
pub fn with_max_memory_bytes(self, bytes: u64) -> Self
Override the per-instance linear-memory cap (bytes).
Sourcepub fn with_trusted_pool_size(self, n: usize) -> Self
pub fn with_trusted_pool_size(self, n: usize) -> Self
Override the trusted pool capacity (max concurrent reusable instances).
Sourcepub fn with_checkout_timeout_ms(self, ms: u64) -> Self
pub fn with_checkout_timeout_ms(self, ms: u64) -> Self
Override the bounded checkout wait (ms) before a saturated trusted pool fails closed.
Sourcepub fn with_max_requests_per_instance(self, n: u64) -> Self
pub fn with_max_requests_per_instance(self, n: u64) -> Self
Override how many requests a trusted instance serves before it is recycled.
Sourcepub fn with_ratelimit_bucket(
self,
capacity: u64,
refill_tokens: u64,
refill_interval_ms: u64,
) -> Self
pub fn with_ratelimit_bucket( self, capacity: u64, refill_tokens: u64, refill_interval_ms: u64, ) -> Self
Configure this filter’s host-side host-ratelimit token bucket (ADR 000026). Without it,
the filter’s try-acquire fails closed. The filter cannot supply or override these.
Sourcepub fn with_config(self, config: BTreeMap<String, String>) -> Self
pub fn with_config(self, config: BTreeMap<String, String>) -> Self
Lend this filter’s manifest-declared business config ([filter.config], ADR 000066) —
a read-only string map the filter reads back via host-config::get.
Trait Implementations§
Source§impl Clone for LoadOptions
impl Clone for LoadOptions
Source§fn clone(&self) -> LoadOptions
fn clone(&self) -> LoadOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LoadOptions
impl Debug for LoadOptions
Auto Trait Implementations§
impl Freeze for LoadOptions
impl RefUnwindSafe for LoadOptions
impl Send for LoadOptions
impl Sync for LoadOptions
impl Unpin for LoadOptions
impl UnsafeUnpin for LoadOptions
impl UnwindSafe for LoadOptions
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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