wasmcloud_interface_factorial

Trait Factorial

Source
pub trait Factorial {
    // Required method
    fn calculate<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        ctx: &'life1 Context,
        arg: &'life2 u32,
    ) -> Pin<Box<dyn Future<Output = RpcResult<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided method
    fn contract_id() -> &'static str { ... }
}
Expand description

The Factorial service has a single method, calculate, which calculates the factorial of its whole number parameter. wasmbus.contractId: wasmcloud:example:factorial wasmbus.providerReceive wasmbus.actorReceive

Required Methods§

Source

fn calculate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 Context, arg: &'life2 u32, ) -> Pin<Box<dyn Future<Output = RpcResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Calculates the factorial (n!) of the input parameter

Provided Methods§

Source

fn contract_id() -> &'static str

returns the capability contract id for this interface

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§