[−][src]Struct wascc_host::WasccHost
Represents an instance of a waSCC host
Implementations
impl WasccHost[src]
pub fn new() -> Self[src]
Creates a new waSCC runtime host
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]
&self,
actor: Actor,
binding: Option<&str>,
wasi: WasiParams
) -> Result<()>
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 set_auth_hook<F>(&self, hook: F) where
F: Fn(&Token<Actor>) -> bool + Sync + Send + 'static, [src]
F: Fn(&Token<Actor>) -> bool + Sync + Send + 'static,
Setting a custom authorization hook allows your code to make additional decisions
about whether or not a given actor is allowed to run within the host. The authorization
hook takes a Token (JSON Web Token) as input and returns a boolean indicating the validity of the module.
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]
&self,
capability_id: &str,
binding_name: Option<String>
) -> Result<()>
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]
&self,
actor: &str,
capid: &str,
binding_name: Option<String>,
config: HashMap<String, String>
) -> Result<()>
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]
&self,
nats_urls: Vec<String>,
jwt: &str,
seed: &str
) -> Result<()>
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]
&self,
actor: &str,
operation: &str,
msg: &[u8]
) -> Result<Vec<u8>>
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
pub fn actors_by_tag(&self, tags: &[&str]) -> Vec<String>[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for WasccHost
impl Send for WasccHost
impl Sync for WasccHost
impl Unpin for WasccHost
impl UnwindSafe for WasccHost
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> Pointee for T
type Pointer = u32
fn debug(
pointer: <T as Pointee>::Pointer,
f: &mut Formatter
) -> Result<(), Error>
pointer: <T as Pointee>::Pointer,
f: &mut Formatter
) -> Result<(), Error>
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,