wasm-capability-contract 0.3.0

Generic, domain-agnostic capability pattern: CapabilityEngine/CapabilityRegistry/CapabilityDispatcher trait shapes + component/capability types. Trait definitions only -- see wasm-capability-core for this pattern's own default implementation, extracted from agent-runtime's ADR-001 (agent-runtime#31, ADR-011).
Documentation
//! [`ResourceLimits`] — bounds the wasmtime engine must enforce for one loaded component.

use serde::{Deserialize, Serialize};

/// Resource bounds a component's host must enforce on every invocation.
///
/// Every field is a hard cap, not a hint — an adapter implementing
/// `ComponentValidator`/the wasmtime engine is expected to reject or trap
/// on any invocation that would exceed one of these, per ADR-001.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub struct ResourceLimits {
    /// Maximum linear memory the component's instance may grow to, in bytes.
    pub max_memory_bytes: u64,
    /// Maximum wall-clock time one invocation may run before being aborted.
    pub invoke_timeout_ms: u64,
    /// Maximum number of concurrent invocations against one loaded instance.
    pub max_concurrency: u32,
    /// Maximum size of a single request or response payload, in bytes.
    pub max_payload_bytes: u64,
}