#[repr(C)]pub struct ResourceEnvelope {
pub max_ticks: u64,
pub max_scratch_bytes: u32,
pub max_vram_bytes: u32,
pub max_output_bytes: u32,
pub max_spawned_tasks: u16,
pub flags: u16,
}Expand description
Worst-case resource budget declared by an extension function and enforced by the Sentinel.
Fields§
§max_ticks: u64Maximum logical instruction / evaluator ticks consumed per invocation.
max_scratch_bytes: u32Maximum cold/scratch arena bytes required (0 for Tier-1 HotZeroHeap).
max_vram_bytes: u32Maximum GPU VRAM bytes required (0 for CPU-only calls).
max_output_bytes: u32Maximum output buffer bytes written (<= CallerOutputSlice capacity).
max_spawned_tasks: u16Maximum child tasks spawned (0 for leaf calls).
flags: u16Reserved flags (0).
Implementations§
Source§impl ResourceEnvelope
impl ResourceEnvelope
Sourcepub const FLAG_ASYNC_BOUNDED_TASK: u16
pub const FLAG_ASYNC_BOUNDED_TASK: u16
ResourceEnvelope::flags bit indicating AsyncExecutionClass::AsyncBoundedTask.
Sourcepub const fn hot_zero_heap(max_ticks: u64, max_output_bytes: u32) -> Self
pub const fn hot_zero_heap(max_ticks: u64, max_output_bytes: u32) -> Self
Default Tier-1 zero-heap compute envelope (max_scratch_bytes = 0, max_vram_bytes = 0).
Sourcepub const fn async_class(&self) -> AsyncExecutionClass
pub const fn async_class(&self) -> AsyncExecutionClass
Returns the synchronous vs bounded-async execution class encoded in flags.
Sourcepub const fn with_async_class(self, class: AsyncExecutionClass) -> Self
pub const fn with_async_class(self, class: AsyncExecutionClass) -> Self
Returns a copy of this envelope with AsyncExecutionClass encoded in flags.
Sourcepub const fn fits_within(&self, budget: &ResourceEnvelope) -> bool
pub const fn fits_within(&self, budget: &ResourceEnvelope) -> bool
Checks whether this envelope fits within budget.