Function

Trait Function 

Source
pub trait Function<'a, InputType: Deserialize<'a>, OutputType: Serialize> {
    // Required method
    fn execute(&self, input: InputType) -> Result<Box<OutputType>, Box<Error>>;
}
Expand description

The Function trait is the interface for runnable functions on Punch FaaS.

§Arguments

  • 'a - lifetime parameter for serde::Deserialize
  • InputType - input type. It implements the trait serde::Deserialize
  • OutputType - output type. It implements the trait serde::Serialize

Required Methods§

Source

fn execute(&self, input: InputType) -> Result<Box<OutputType>, Box<Error>>

Returns a pointer to the computed result.

§Arguments
  • input - function input

Implementors§