Struct wasmcloud_host::Host[][src]

pub struct Host { /* fields omitted */ }

A wasmCloud Host is a secure runtime container responsible for scheduling actors and capability providers, configuring the links between them, and facilitating secure function call dispatch between actors and capabilities.

Implementations

impl Host[src]

pub async fn start(&self) -> Result<()>[src]

Starts the host’s actor system. This call is non-blocking, so it is up to the consumer to provide some form of parking or waiting (e.g. wait for a Ctrl-C signal).

pub async fn stop(&self)[src]

Stops a running host. Be aware that this function may terminate before the host has finished disposing of all of its resources

pub fn id(&self) -> String[src]

Returns the unique public key (a 56-character upppercase string beginning with the letter N) of this host. The host’s private key is used to securely sign invocations so that remote hosts can perform anti-forgery checks

pub async fn start_native_capability(
    &self,
    capability: NativeCapability
) -> Result<()>
[src]

Starts a native (non-portable dynamically linked library plugin) capability provider and preps it for execution in the host

pub async fn start_capability_from_registry(
    &self,
    cap_ref: &str,
    link_name: Option<String>
) -> Result<()>
[src]

Instructs the host to download a capability provider from an OCI registry and start it. The wasmCloud host caches binary images retrieved from OCI registries (because images are assumed to be immutable this kind of caching is acceptable). If you need to purge the OCI image cache, remove the wasmcloud_cache directory from your environment’s TEMP directory.

pub async fn start_actor(&self, actor: Actor) -> Result<()>[src]

Instructs the runtime host to start an actor.

pub async fn start_actor_from_registry(&self, actor_ref: &str) -> Result<()>[src]

Instructs the runtime host to download the actor from the indicated OCI registry and start the actor. This call will fail if the host cannot communicate with or finish downloading the indicated OCI image

pub async fn stop_actor(&self, actor_ref: &str) -> Result<()>[src]

Stops a running actor in the host. This call is assumed to be idempotent and as such will not fail if you attempt to stop an actor that is not running (though this may result in errors or warnings in log output)

pub async fn stop_provider(
    &self,
    provider_ref: &str,
    contract_id: &str,
    link: Option<String>
) -> Result<()>
[src]

Stops a running capability provider. This call will not fail if the indicated provider is not currently running, and this call may terminate before the provider has finished shutting down cleanly

pub async fn get_actors(&self) -> Result<Vec<String>>[src]

Retrieves the list of all actors within this host. This function call does not include any actors remotely running in a connected lattice

pub async fn get_providers(&self) -> Result<Vec<String>>[src]

Retrieves the list of capability providers running in the host. This function does not include any capability providers that may be remotely running in a connected lattice

pub async fn call_actor(
    &self,
    actor: &str,
    operation: &str,
    msg: &[u8]
) -> Result<Vec<u8>>
[src]

Perform a raw waPC-style invocation on the given actor by supplying an operation string and a payload of raw bytes, resulting in a payload of raw response bytes. It is entirely up to the actor as to how it responds to unrecognized operations. This operation will also be checked against the authorization system if a custom authorization plugin has been supplied to this host. You may supply either the actor’s public key or the actor’s registered call alias. This call will fail if you attempt to invoke a non-existent actor or call alias.

Links are a self-standing, durable entity within a lattice and host runtime. A link defines a set of configuration values that apply to an actor and a capability provider indicated by the provider’s contract ID, public key, and link name. You can set a link before or after either the actor or provider are started. Links are automatically established when both parties are present in a lattice, and re-established if a party temporarily leaves the lattice and rejoins (which can happen during a crash or a partition event). Link data is exactly as durable as your choice of lattice cache provider

pub async fn apply_manifest(&self, manifest: HostManifest) -> Result<()>[src]

Apply a number of instructions from a manifest file to the runtime host. A manifest file can contain a list of actors, capability providers, and link definitions that will be added to a host upon ingestion. Manifest application is not idempotent, so repeated application of multiple manifests may not always produce the same runtime host state

Auto Trait Implementations

impl !RefUnwindSafe for Host

impl Send for Host

impl Sync for Host

impl Unpin for Host

impl !UnwindSafe for Host

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,