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§
Sourceasync fn publish(
self,
context: Context,
wasm_file: Vec<u8>,
name: String,
github_auth_token: String,
) -> FunctionResult<String>
async fn publish( self, context: Context, wasm_file: Vec<u8>, name: String, github_auth_token: String, ) -> FunctionResult<String>
Publish a new function
Sourceasync fn list_functions(
self,
context: Context,
github_auth_token: String,
) -> FunctionResult<Vec<FunctionInfo>>
async fn list_functions( self, context: Context, github_auth_token: String, ) -> FunctionResult<Vec<FunctionInfo>>
List all functions for the authenticated user
Sourceasync fn unpublish(
self,
context: Context,
name: String,
github_auth_token: String,
) -> FunctionResult<()>
async fn unpublish( self, context: Context, name: String, github_auth_token: String, ) -> FunctionResult<()>
Unpublish a function
Sourceasync fn get_metrics(
self,
context: Context,
github_auth_token: String,
) -> FunctionResult<Metrics>
async fn get_metrics( self, context: Context, github_auth_token: String, ) -> FunctionResult<Metrics>
Get metrics for all functions
Provided Methods§
Sourcefn serve(self) -> ServeFunctionService<Self>
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.