Expand description
Code generation helpers for Momento Functions
This crate generates Momento Functions webassembly bindings.
Functions use wasm32-wasip2 as the target architecture.
They use the WIT Component Model
to describe the ABI.
You are likely to be interested in the sibling crates:
momento-functions-host: Interfaces and tools for calling host interfaces.momento-functions-log: Standardlogadapter.
Macros§
- post
- Create a handler that accepts a post payload and returns a response.
- spawn
- Create a handler for a momento::host::spawn::spawn_function.
Structs§
- WebError
- A WebError represents an error result produced by a function execution.
Functionally, it is also just an HTTP response - however, this allows for writing
functions with a return signature of
WebResultif you are okay with all errors being converted to 500s and returned in the body. - WebResponse
- This represents a response from a web function. When constructed, it’s a 200 response with no headers or body. You can set the status, headers, and body via WebResponse::with_status, WebResponse::with_headers, and WebResponse::with_body respectfully.
Traits§
- Into
WebResponse - Values returned by a function implemented with the crate::post! macro must implement this trait.
Type Aliases§
- WebResult
- A Result type for implementing functions. Allows you to use
?within your function body to return a 500 with the error details.