Skip to main content

wasm_capability_contract/component/vo/
component_handle.rs

1//! [`ComponentHandle`] — an opaque reference to a component instance a
2//! `CapabilityEngine` has loaded, returned from `load` and consumed by
3//! `invoke`.
4
5use serde::{Deserialize, Serialize};
6
7/// Opaque handle to a loaded component instance.
8///
9/// Deliberately a plain newtype over `String`, not exposing any
10/// engine-internal state, so this port stays independent of whatever the
11/// concrete engine uses to key its own cache/pool internally. Callers must
12/// treat it as an unstructured token: construct it only from a
13/// [`crate::CapabilityEngine::load`] response, never by hand.
14#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
15pub struct ComponentHandle(pub String);