[−][src]Trait wascc_codec::capabilities::CapabilityProvider
Every capability provider must implement this trait
Required methods
fn configure_dispatch(
&self,
dispatcher: Box<dyn Dispatcher>
) -> Result<(), Box<dyn Error>>
&self,
dispatcher: Box<dyn Dispatcher>
) -> Result<(), Box<dyn Error>>
This function will be called on the provider when the host runtime is ready and has configured a dispatcher. This function is only ever called once for a capability provider, regardless of the number of actors being managed in the host
fn capability_id(&self) -> &'static str
The capability provider will return either one of the well-known capability IDs or a custom capability ID using namespace:id
notation
fn name(&self) -> &'static str
The human-readable, friendly name of this capability provider. By convention, the provider should include information about the specific implementation, e.g. contain the name "Redis" for a K/V store or "NATS" for a message broker.
fn handle_call(
&self,
actor: &str,
op: &str,
msg: &[u8]
) -> Result<Vec<u8>, Box<dyn Error>>
&self,
actor: &str,
op: &str,
msg: &[u8]
) -> Result<Vec<u8>, Box<dyn Error>>
This function is called by the host runtime when an actor module requests an operation be executed by the capability provider