pub trait Handler<TCtx, TInput, TOutput, TError>:
Send
+ Sync
+ 'static {
// Required method
fn call(
&self,
ctx: TCtx,
input: TInput,
) -> BoxFuture<'static, Result<TOutput, TError>>;
}Expand description
Handler function signature. Auto-implemented for async fn with matching signature.
Prefer named async functions over closures for better type inference:
ⓘ
async fn list_planets(ctx: AppCtx, input: ListInput) -> Result<Vec<Planet>, ORPCError> { ... }
os.handler(list_planets)