pub struct ExecutionLimits {
pub memory_bytes: usize,
pub table_elements: usize,
pub instances: usize,
pub deadline_seconds: u64,
}Expand description
Fully-resolved execution limits for one session’s guests: the manifest’s
capabilities.limits block with every omitted field replaced by its DEFAULT_*.
Fields§
§memory_bytes: usizeCap on linear-memory growth, in bytes.
table_elements: usizeCap on table growth, in elements.
instances: usizeCap on instances a single store may create.
deadline_seconds: u64Wall-clock budget for a single guest invocation, in seconds.
Implementations§
Source§impl ExecutionLimits
impl ExecutionLimits
Sourcepub fn resolve(declared: Option<&ResourceLimits>) -> Self
pub fn resolve(declared: Option<&ResourceLimits>) -> Self
Resolve a manifest capabilities.limits block, substituting the default for each
field the manifest left out (and for the whole block when it is absent).
Sourcepub fn for_hook_calls(self, declared_deadline_seconds: Option<u64>) -> Self
pub fn for_hook_calls(self, declared_deadline_seconds: Option<u64>) -> Self
This limit block re-flavored for hook lifecycle calls: every resource cap unchanged,
but the wall-clock budget falls back to HOOK_DEFAULT_DEADLINE_SECONDS instead of
DEFAULT_DEADLINE_SECONDS when the operator declared none.
Takes the undefaulted capabilities.limits.deadline_seconds rather than reading it
back off self, because that is the only way to tell “the operator set nothing” from
“the operator explicitly set 600” — the second must be honored verbatim, hooks
included. Callers get it from crate::CapabilityPolicy::hook_limits.
Trait Implementations§
Source§impl Clone for ExecutionLimits
impl Clone for ExecutionLimits
impl Copy for ExecutionLimits
Source§impl Debug for ExecutionLimits
impl Debug for ExecutionLimits
Source§impl Default for ExecutionLimits
impl Default for ExecutionLimits
Source§impl<'de> Deserialize<'de> for ExecutionLimits
impl<'de> Deserialize<'de> for ExecutionLimits
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ExecutionLimits
Source§impl PartialEq for ExecutionLimits
impl PartialEq for ExecutionLimits
Source§impl Serialize for ExecutionLimits
impl Serialize for ExecutionLimits
impl StructuralPartialEq for ExecutionLimits
Auto Trait Implementations§
impl Forget for ExecutionLimits
impl Freeze for ExecutionLimits
impl Move for ExecutionLimits
impl RefUnwindSafe for ExecutionLimits
impl Send for ExecutionLimits
impl Sync for ExecutionLimits
impl Unpin for ExecutionLimits
impl UnsafeUnpin for ExecutionLimits
impl UnwindSafe for ExecutionLimits
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moreSource§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
Source§type NoneType = T
type NoneType = T
NoneValue::null_value produces.