#[non_exhaustive]pub struct TaskRetentionLimits {
pub max_tasks: usize,
pub max_payload_bytes: usize,
pub max_retained_bytes: usize,
}Expand description
Byte and record limits for MemoryTaskStore.
Defaults are deliberately finite: 1,024 retained task records, 4 MiB for
any one accepted identity, arguments, metadata, input, status-message,
result, or error payload, and 64 MiB of aggregate retained payload charge. Use
unbounded only when a host provides an equivalent
bound outside this store.
Byte sizes are the compact JSON encoding produced by serde_json. The
aggregate charge covers the retained tool name, owner, arguments,
metadata, status message, input requests and their spent keys,
accumulated input responses, result, and structured error. It deliberately
excludes HashMap allocation overhead and fixed lifecycle machinery such
as IDs, timestamps, cancellation tokens, and waiter handles; the task-count
limit bounds that fixed per-record overhead.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_tasks: usizeMaximum task records physically retained, including expired tombstones.
max_payload_bytes: usizeMaximum compact-JSON bytes for one accepted payload.
max_retained_bytes: usizeMaximum aggregate retained and reserved compact-JSON bytes.
Implementations§
Source§impl TaskRetentionLimits
impl TaskRetentionLimits
Sourcepub const fn unbounded() -> Self
pub const fn unbounded() -> Self
Disable the in-memory store’s count and byte limits.
Prefer the finite Default unless another layer enforces equivalent
process-memory limits.
Sourcepub const fn max_tasks(self, max: usize) -> Self
pub const fn max_tasks(self, max: usize) -> Self
Set the maximum number of physically retained task records.
Sourcepub const fn max_payload_bytes(self, max: usize) -> Self
pub const fn max_payload_bytes(self, max: usize) -> Self
Set the compact-JSON limit for one accepted payload.
Sourcepub const fn max_retained_bytes(self, max: usize) -> Self
pub const fn max_retained_bytes(self, max: usize) -> Self
Set the aggregate retained-and-reserved compact-JSON byte limit.
Trait Implementations§
Source§impl Clone for TaskRetentionLimits
impl Clone for TaskRetentionLimits
Source§fn clone(&self) -> TaskRetentionLimits
fn clone(&self) -> TaskRetentionLimits
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 TaskRetentionLimits
Source§impl Debug for TaskRetentionLimits
impl Debug for TaskRetentionLimits
Source§impl Default for TaskRetentionLimits
impl Default for TaskRetentionLimits
impl Eq for TaskRetentionLimits
Source§impl PartialEq for TaskRetentionLimits
impl PartialEq for TaskRetentionLimits
impl StructuralPartialEq for TaskRetentionLimits
Auto Trait Implementations§
impl Freeze for TaskRetentionLimits
impl RefUnwindSafe for TaskRetentionLimits
impl Send for TaskRetentionLimits
impl Sync for TaskRetentionLimits
impl Unpin for TaskRetentionLimits
impl UnsafeUnpin for TaskRetentionLimits
impl UnwindSafe for TaskRetentionLimits
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.