Expand description
§wasmCloud Host
wasmCloud is an open source Cloud Native Computing Foundation (CNCF) project that enables teams to build, manage, and scale polyglot Wasm apps across any cloud, K8s, or edge.
⚠️ This crate is highly experimental and likely to experience breaking changes frequently. The host itself is relatively stable, but the APIs and public members of this crate are not guaranteed to be stable.
§Usage
This crate can be used to embed a wasmCloud host in a Rust application. You can refer to the wasmcloud-main-rs file of the wasmCloud runtime for an example of this.
This library provides the host runtime for wasmCloud, which is a platform for running WebAssembly (Wasm) components and plugins. It includes pluggable support for various extensions and integrations, allowing developers to customize and extend the host’s functionality.
§Key Modules
- config: Implements the
crate::config::ConfigManagertrait for managing a configuration store that can be watched for updates. This is a supertrait ofcrate::store::StoreManagerand is implemented bycrate::store::DefaultStore. - event: Provides the
crate::event::EventManagertrait for handling and dispatching events from the wasmCloud host - metrics: Implements OpenTelemetry metrics for wasmCloud, primarily using the
crate::metricsmodule for tracing and monitoring. - nats: Contains the NATS-based implementations for the wasmCloud host extension traits
- oci: Offers configuration and utilities for fetching OCI (Open Container Initiative) artifacts
- policy: Defines the
crate::policy::PolicyManagertrait for applying additional security policies on top of the wasmCloud host. - registry: Provides the
crate::registry::RegistryCredentialExtextension trait for working with registry credentials and configurations. - secrets: Contains the
crate::secrets::SecretsManagertrait for securely fetching secrets from a secret store. - store: Defines the
crate::store::StoreManagertrait for managing configuration and data from a backing store. - wasmbus: Contains the core implementation of the wasmCloud host functionality, including the
crate::wasmbus::Hoststruct and related configurations. - workload_identity: Experimental module for workload identity implementations, providing tools for identity management.
§Extending the Host
The top-level modules in this crate expose implementable extension traits that allow developers to extend the host’s functionality. These traits can be supplied to an embedded host using the crate::wasmbus::HostBuilder.
For example, you can implement custom policies, secrets management, or registry configurations to tailor the host to your specific needs.
The wasmCloud wasmcloud-main-rs binary uses the implementations in nats to provide a NATS-based host runtime. This allows you to run wasmCloud components and plugins in a distributed environment, leveraging NATS for messaging and communication.
§Getting Started
To get started with wasmCloud, refer to wasmbus for the core host functionality. From there, you can explore the other modules to add extensions and integrations as needed.
For more information, visit the wasmcloud-homepage.
Re-exports§
pub use oci::Config as OciConfig;pub use policy::HostInfo as PolicyHostInfo;pub use policy::PolicyManager;pub use policy::Response as PolicyResponse;pub use wasmbus::Host as WasmbusHost;pub use wasmbus::HostConfig as WasmbusHostConfig;
Modules§
- config
- crate::config::ConfigManager trait for managing a config store which can be watched to receive updates to the config. This is a supertrait of crate::store::StoreManager and is implemented by crate::store::DefaultStore.
- event
- crate::event::EventPublisher trait for receiving and publishing events from the host
- metrics
- Implementation of OpenTelemetry metrics for wasmCloud, primarily using wasmcloud_tracing
- nats
- NATS implementations of crate::policy::PolicyManager, crate::secrets::SecretsManager, and crate::store::StoreManager traits for the wasmCloud host. NATS implementations of wasmCloud crate::wasmbus::Host extension traits
- oci
- Configuration for OCI artifact fetching crate::oci::Config
- policy
- crate::policy::PolicyManager trait for layering additional security policies on top of the wasmCloud host
- registry
- crate::registry::RegistryCredentialExt extension trait for converting registry credentials into wasmcloud_core::RegistryConfig
- secrets
- crate::secrets::SecretsManager trait for fetching secrets from a secret store Module with structs for use in managing and accessing secrets in a wasmCloud lattice
- store
- crate::store::StoreManager trait for fetching configuration and data from a backing store Module with structs for use in managing and accessing data used by various wasmCloud entities
- wasmbus
- crate::wasmbus::Host implementation
- workload_
identity - experimental workload identity implementation
Enums§
- Resource
Ref - A reference to a resource, either a file, an OCI image, or a builtin provider
Functions§
- fetch_
component - Fetch an component from a reference.