Skip to main content

BackendCallFn

Type Alias BackendCallFn 

Source
pub type BackendCallFn<B, C> = dyn Fn(Arc<B>, String, Value, C) -> HandlerFuture + Send + Sync + 'static;
Expand description

Type alias for the closure stored inside ClosureHandler.

The String argument is the call_id (the client-supplied correlation identifier from RFC 8620 §3.3), not the method name. If you need the method name inside the closure, register the handler with Dispatcher::register and use JmapHandler directly instead.

C is the caller context (e.g. an auth identity) forwarded from Dispatcher::dispatch. Closures that don’t need it can ignore the argument with _ctx.