#[non_exhaustive]pub enum InvokeError {
InvalidName,
NotFound,
InvalidLimits(ConfigError),
Overloaded,
TenantBusy,
CpuBudgetExceeded {
usage: Usage,
budget_ms: u64,
},
MemoryCapExceeded {
usage: Usage,
cap_bytes: usize,
},
WallClockTimeout {
usage: Usage,
},
OutputTooLarge {
usage: Usage,
limit: usize,
},
GuestTrap {
usage: Usage,
source: Error,
},
Load(Error),
}Expand description
Why Runtime::invoke failed. Non-exhaustive.
Variants that carry a Usage failed after the guest started running;
those invocations were reported to the configured
MeterSink. The others were rejected before the
guest ran and were not metered.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidName
NotFound
InvalidLimits(ConfigError)
limits.cpu_budget_ms or limits.mem_cap_bytes is outside the valid
range (possible only if the fields were mutated after Limits::new).
Overloaded
The host’s memory budget cannot admit this invocation right now (or the tenant’s memory cap alone exceeds the whole budget).
TenantBusy
The tenant already has max_in_flight_per_tenant invocations running.
CpuBudgetExceeded
MemoryCapExceeded
WallClockTimeout
OutputTooLarge
GuestTrap
Load(Error)
The module could not be loaded (corrupt registry state, compile failure of the stored source, …).
Implementations§
Source§impl InvokeError
impl InvokeError
Sourcepub fn usage(&self) -> Option<Usage>
pub fn usage(&self) -> Option<Usage>
What the guest used before failing; None when it never ran.
Sourcepub fn http_status(&self) -> u16
pub fn http_status(&self) -> u16
A suitable HTTP status code: 400 invalid name / invalid limits, 404 not found, 503 overloaded, 429 tenant busy, 408 cpu budget / wall clock, 507 memory cap, 502 output too large, 500 guest trap / load failure.
Trait Implementations§
Source§impl Debug for InvokeError
impl Debug for InvokeError
Source§impl Display for InvokeError
impl Display for InvokeError
Source§impl Error for InvokeError
impl Error for InvokeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ConfigError> for InvokeError
impl From<ConfigError> for InvokeError
Source§fn from(source: ConfigError) -> Self
fn from(source: ConfigError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for InvokeError
impl !UnwindSafe for InvokeError
impl Freeze for InvokeError
impl Send for InvokeError
impl Sync for InvokeError
impl Unpin for InvokeError
impl UnsafeUnpin for InvokeError
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> 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