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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! [`ComponentHandle`] — an opaque reference to a component instance a
//! `CapabilityEngine` has loaded, returned from `load` and consumed by
//! `invoke`.

use serde::{Deserialize, Serialize};

/// Opaque handle to a loaded component instance.
///
/// Deliberately a plain newtype over `String`, not exposing any
/// engine-internal state, so this port stays independent of whatever the
/// concrete engine uses to key its own cache/pool internally. Callers must
/// treat it as an unstructured token: construct it only from a
/// [`crate::CapabilityEngine::load`] response, never by hand.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct ComponentHandle(pub String);