pub struct ComponentManifest {
pub id: ModuleId,
pub description: Option<String>,
pub exports: InterfaceList,
pub imports: InterfaceList,
pub capabilities: ComponentCapabilities,
}Expand description
A portable, human-readable descriptor of a WebAssembly component.
The manifest captures what a component is, what it provides, and what it needs — independently of any specific runtime. It serves three key purposes:
- Identity:
id(name@version) uniquely identifies the component. - Contract:
importsandexportsdefine its interface boundary (like a WIT package). - Intent:
capabilitiesexpress environmental requirements (WASI, FS, network, etc.).
This structure supports three input formats during deserialization:
- String:
"name@version"(e.g., in deployment specs) - Flat object:
{ "name": "...", "version": "...", ... }(e.g., incomponent.toml) - Nested object:
{ "id": { "name": "...", "version": "..." }, ... }(e.g., in JSON state snapshots)
Fields§
§id: ModuleIdCanonical, validated identifier of the component: name@version.
description: Option<String>Optional short description for documentation or tooling.
exports: InterfaceListInterfaces this component provides to others.
Each key must be a valid WIT-style interface name:
- With version:
"logger:log@1.0" - Without version:
"my:custom"
Values are structured interface specs (e.g., ComponentInstance trees).
When loaded from a simple config (e.g., TOML array), they default to Unknown.
imports: InterfaceListInterfaces this component requires from its environment.
Same format as exports. These must be satisfied at link time by:
- The runtime (e.g.,
wasi:cli/stdio), - Other deployed components (e.g.,
"auth:validator@1.0").
capabilities: ComponentCapabilitiesRuntime capabilities and resource requirements.
Used by the Arcella executor to:
- Grant minimal required permissions,
- Enforce sandboxing,
- Allocate resources safely.
Implementations§
Source§impl ComponentManifest
impl ComponentManifest
Sourcepub fn validate(&self) -> ArcellaTypeResult<()>
pub fn validate(&self) -> ArcellaTypeResult<()>
Validates the semantic correctness of the entire manifest.
Since id is a ModuleId, name and version are already valid.
This method only checks interface formats.
Sourcepub fn validate_interface_format(s: &str) -> bool
pub fn validate_interface_format(s: &str) -> bool
Checks if a string matches the expected WIT interface reference format.
Two forms are accepted:
- With version:
namespace:interface@version(e.g.,wasi:http@0.2.0) - Without version:
namespace:interface(e.g.,my:custom)
Interface part may contain / for nested paths (e.g., wasi:cli/stdio).
Trait Implementations§
Source§impl Clone for ComponentManifest
impl Clone for ComponentManifest
Source§fn clone(&self) -> ComponentManifest
fn clone(&self) -> ComponentManifest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ComponentManifest
impl Debug for ComponentManifest
Source§impl<'de> Deserialize<'de> for ComponentManifest
impl<'de> Deserialize<'de> for ComponentManifest
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>,
Source§impl PartialEq for ComponentManifest
impl PartialEq for ComponentManifest
Source§impl Serialize for ComponentManifest
impl Serialize for ComponentManifest
impl Eq for ComponentManifest
impl StructuralPartialEq for ComponentManifest
Auto Trait Implementations§
impl Freeze for ComponentManifest
impl RefUnwindSafe for ComponentManifest
impl Send for ComponentManifest
impl Sync for ComponentManifest
impl Unpin for ComponentManifest
impl UnwindSafe for ComponentManifest
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
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§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.