Trait FunctionService

Source
pub trait FunctionService: Sized {
    // Required methods
    async fn publish(
        self,
        context: Context,
        wasm_file: Vec<u8>,
        name: String,
        github_auth_token: String,
    ) -> FunctionResult<String>;
    async fn list_functions(
        self,
        context: Context,
        github_auth_token: String,
    ) -> FunctionResult<Vec<FunctionInfo>>;
    async fn unpublish(
        self,
        context: Context,
        name: String,
        github_auth_token: String,
    ) -> FunctionResult<()>;
    async fn get_metrics(
        self,
        context: Context,
        github_auth_token: String,
    ) -> FunctionResult<Metrics>;

    // Provided method
    fn serve(self) -> ServeFunctionService<Self> { ... }
}
Expand description

Service interface for managing functions

Required Methods§

Source

async fn publish( self, context: Context, wasm_file: Vec<u8>, name: String, github_auth_token: String, ) -> FunctionResult<String>

Publish a new function

Source

async fn list_functions( self, context: Context, github_auth_token: String, ) -> FunctionResult<Vec<FunctionInfo>>

List all functions for the authenticated user

Source

async fn unpublish( self, context: Context, name: String, github_auth_token: String, ) -> FunctionResult<()>

Unpublish a function

Source

async fn get_metrics( self, context: Context, github_auth_token: String, ) -> FunctionResult<Metrics>

Get metrics for all functions

Provided Methods§

Source

fn serve(self) -> ServeFunctionService<Self>

Returns a serving function to use with InFlightRequest::execute.

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§