pub struct RuntimeBudget { /* private fields */ }Expand description
Multi-dimensional resource envelope for one runtime session.
Zero is a valid fail-closed value for every dimension. For example,
max_total_requests == 0 prevents even bootstrap I/O.
Implementations§
Source§impl RuntimeBudget
impl RuntimeBudget
Sourcepub const fn new(
max_total_requests: u32,
max_wall_time_ms: u64,
max_response_bytes: u64,
max_active_verifications: u16,
max_same_action_attempts: u16,
max_consecutive_no_progress_turns: u16,
) -> Self
pub const fn new( max_total_requests: u32, max_wall_time_ms: u64, max_response_bytes: u64, max_active_verifications: u16, max_same_action_attempts: u16, max_consecutive_no_progress_turns: u16, ) -> Self
Creates an explicit resource envelope.
Sourcepub const fn max_total_requests(self) -> u32
pub const fn max_total_requests(self) -> u32
Returns the maximum number of requests, including bootstrap and retries.
Sourcepub const fn max_wall_time(self) -> Duration
pub const fn max_wall_time(self) -> Duration
Returns the monotonic wall-clock limit.
Sourcepub const fn max_wall_time_ms(self) -> u64
pub const fn max_wall_time_ms(self) -> u64
Returns the serialized wall-clock limit in milliseconds.
Sourcepub const fn max_response_bytes(self) -> u64
pub const fn max_response_bytes(self) -> u64
Returns the cumulative transport-delivered response-body threshold.
The chunk that crosses this threshold is charged in full and surfaced as a typed limit; the broker starts no later body read.
Sourcepub const fn max_request_body_bytes(self) -> u64
pub const fn max_request_body_bytes(self) -> u64
Returns the cumulative request-body byte limit.
Headers and transport framing are not included. A body is charged atomically immediately before its request is dispatched.
Sourcepub const fn max_active_verifications(self) -> u16
pub const fn max_active_verifications(self) -> u16
Returns the maximum number of active verification requests.
Sourcepub const fn max_same_action_attempts(self) -> u16
pub const fn max_same_action_attempts(self) -> u16
Returns the maximum number of attempts for one semantic action.
Sourcepub const fn max_consecutive_no_progress_turns(self) -> u16
pub const fn max_consecutive_no_progress_turns(self) -> u16
Returns the maximum consecutive completed no-progress turns.
Sourcepub const fn with_max_total_requests(self, limit: u32) -> Self
pub const fn with_max_total_requests(self, limit: u32) -> Self
Replaces the total-request limit.
Sourcepub fn with_max_wall_time(self, limit: Duration) -> Self
pub fn with_max_wall_time(self, limit: Duration) -> Self
Replaces the wall-clock limit, saturating at the wire representation.
Sourcepub const fn with_max_response_bytes(self, limit: u64) -> Self
pub const fn with_max_response_bytes(self, limit: u64) -> Self
Replaces the cumulative transport-delivered response-body threshold.
Sourcepub const fn with_max_request_body_bytes(self, limit: u64) -> Self
pub const fn with_max_request_body_bytes(self, limit: u64) -> Self
Replaces the cumulative request-body byte limit.
Sourcepub const fn with_max_active_verifications(self, limit: u16) -> Self
pub const fn with_max_active_verifications(self, limit: u16) -> Self
Replaces the active-verification request limit.
Sourcepub const fn with_max_same_action_attempts(self, limit: u16) -> Self
pub const fn with_max_same_action_attempts(self, limit: u16) -> Self
Replaces the per-action attempt limit.
Sourcepub const fn with_max_consecutive_no_progress_turns(self, limit: u16) -> Self
pub const fn with_max_consecutive_no_progress_turns(self, limit: u16) -> Self
Replaces the consecutive no-progress turn limit.
Trait Implementations§
Source§impl Clone for RuntimeBudget
impl Clone for RuntimeBudget
Source§fn clone(&self) -> RuntimeBudget
fn clone(&self) -> RuntimeBudget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RuntimeBudget
Source§impl Debug for RuntimeBudget
impl Debug for RuntimeBudget
Source§impl Default for RuntimeBudget
impl Default for RuntimeBudget
Source§impl<'de> Deserialize<'de> for RuntimeBudgetwhere
RuntimeBudget: Default,
impl<'de> Deserialize<'de> for RuntimeBudgetwhere
RuntimeBudget: Default,
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 RuntimeBudget
Source§impl PartialEq for RuntimeBudget
impl PartialEq for RuntimeBudget
Source§impl Serialize for RuntimeBudget
impl Serialize for RuntimeBudget
impl StructuralPartialEq for RuntimeBudget
Auto Trait Implementations§
impl Freeze for RuntimeBudget
impl RefUnwindSafe for RuntimeBudget
impl Send for RuntimeBudget
impl Sync for RuntimeBudget
impl Unpin for RuntimeBudget
impl UnsafeUnpin for RuntimeBudget
impl UnwindSafe for RuntimeBudget
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.