[][src]Struct wascc_host::Host

pub struct Host { /* fields omitted */ }

Represents an instance of a waSCC host

Implementations

impl Host[src]

pub fn new() -> Self[src]

Creates a new runtime host using all of the default values. Use the host builder if you want to provide more customization options

pub fn set_label(&self, label: &str, value: &str)[src]

Sets an arbitrary label on the host. Discoverable via lattice query

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

Adds an actor to the host

pub fn add_actor_from_gantry(&self, actor: &str) -> Result<()>[src]

Adds an actor to the host by looking it up in a Gantry repository, downloading the signed module bytes, and adding them to the host

pub fn add_capability(
    &self,
    actor: Actor,
    binding: Option<&str>,
    wasi: WasiParams
) -> Result<()>
[src]

Adds a portable capability provider (e.g. a WASI actor) to the waSCC host

pub fn remove_actor(&self, pk: &str) -> Result<()>[src]

Removes an actor from the host. Notifies the actor's processing thread to terminate, which will in turn attempt to unbind that actor from all previously bound capability providers

pub fn replace_actor(&self, new_actor: Actor) -> Result<()>[src]

Replaces one running actor with another live actor with no message loss. Note that the time it takes to perform this replacement can cause pending messages from capability providers (e.g. messages from subscriptions or HTTP requests) to build up in a backlog, so make sure the new actor can handle this stream of these delayed messages

pub fn add_middleware(&self, mid: impl Middleware)[src]

Adds a middleware item to the middleware processing pipeline

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

Adds a native capability provider plugin to the waSCC runtime. Note that because these capabilities are native, cross-platform support is not always guaranteed.

pub fn remove_native_capability(
    &self,
    capability_id: &str,
    binding_name: Option<String>
) -> Result<()>
[src]

Removes a native capability provider plugin from the waSCC runtime

pub fn bind_actor(
    &self,
    actor: &str,
    capid: &str,
    binding_name: Option<String>,
    config: HashMap<String, String>
) -> Result<()>
[src]

Binds an actor to a capability provider with a given configuration. If the binding name is None then the default binding name will be used. An actor can only have one default binding per capability provider.

pub fn configure_gantry(
    &self,
    nats_urls: Vec<String>,
    jwt: &str,
    seed: &str
) -> Result<()>
[src]

Configure the Gantry client connection information to be used when actors are loaded remotely via Actor::from_gantry

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

Invoke an operation handler on an actor directly. The caller is responsible for knowing ahead of time if the given actor supports the specified operation.

pub fn claims_for_actor(&self, pk: &str) -> Option<Claims<Actor>>[src]

Returns the full set of JWT claims for a given actor, if that actor is running in the host

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

Applies a manifest JSON or YAML file to set up a host's actors, capability providers, and actor bindings

pub fn actors(&self) -> Vec<SubjectClaimsPair>[src]

Returns the list of actors registered in the host

pub fn capabilities(&self) -> HashMap<(String, String), CapabilityDescriptor>[src]

Returns the list of capability providers registered in the host. The key is a tuple of (binding, capability ID)

pub fn actors_by_tag(&self, tags: &[&str]) -> Vec<String>[src]

Returns the list of actors in the host that contain all of the tags in the supplied parameter

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

Attempts to perform a graceful shutdown of the host by removing all actors in the host and then removing all capability providers. This function is not guaranteed to block and wait for the shutdown to finish

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

Returns the public key of the host

Trait Implementations

impl Clone for Host[src]

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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointee for T

type Pointer = u32

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,