pub struct Limits {
pub max_input_bytes: u64,
pub max_output_bytes: u64,
pub max_block_bytes: u32,
pub max_payload_bytes: u32,
pub max_model_bytes: u32,
pub max_blocks: u64,
pub max_trace_symbols: u64,
pub max_oracle_output_bytes: u64,
pub oracle_timeout: Duration,
}Expand description
Central resource limits.
Fields§
§max_input_bytes: u64Maximum input bytes to read.
max_output_bytes: u64Maximum output bytes to produce.
max_block_bytes: u32Maximum bytes per uncompressed block.
max_payload_bytes: u32Maximum bytes per compressed payload.
max_model_bytes: u32Maximum bytes per model encoding.
max_blocks: u64Maximum number of blocks.
max_trace_symbols: u64Maximum trace symbols to emit.
max_oracle_output_bytes: u64Maximum bytes to capture from oracle output.
oracle_timeout: DurationMaximum wall-clock time for oracle execution.
Implementations§
Source§impl Limits
impl Limits
Sourcepub fn check_block_size(&self, size: u32) -> Result<(), AppError>
pub fn check_block_size(&self, size: u32) -> Result<(), AppError>
Check that a block’s declared uncompressed length is within limits.
Sourcepub fn check_payload_size(&self, size: u32) -> Result<(), AppError>
pub fn check_payload_size(&self, size: u32) -> Result<(), AppError>
Check that a block’s declared payload length is within limits.
Sourcepub fn check_model_size(&self, size: u32) -> Result<(), AppError>
pub fn check_model_size(&self, size: u32) -> Result<(), AppError>
Check that a model length is within limits.
Sourcepub fn check_block_count(&self, count: u64) -> Result<(), AppError>
pub fn check_block_count(&self, count: u64) -> Result<(), AppError>
Check that the block count does not exceed the limit.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnsafeUnpin for Limits
impl UnwindSafe for Limits
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
Mutably borrows from an owned value. Read more