pub trait Procedure:
Send
+ Sync
+ 'static {
// Required methods
fn id(&self) -> ProcedureId;
fn handle<'cx>(&'cx self, cx: &'cx Cx, body: Body) -> ProcedureFuture<'cx>;
}Available on crate feature
router only.Expand description
An async server function callable from the client runtime.
Registered into a RouterBuilder with
procedure, which serves it as a
route dispatched by ProcedureId.
Required Methods§
Sourcefn id(&self) -> ProcedureId
fn id(&self) -> ProcedureId
The identity of this procedure.
Sourcefn handle<'cx>(&'cx self, cx: &'cx Cx, body: Body) -> ProcedureFuture<'cx>
fn handle<'cx>(&'cx self, cx: &'cx Cx, body: Body) -> ProcedureFuture<'cx>
Handles a procedure call, deserializing its arguments from body.
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".