Skip to main content

Procedure

Trait Procedure 

Source
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§

Source

fn id(&self) -> ProcedureId

The identity of this procedure.

Source

fn handle<'cx>(&'cx self, cx: &'cx Cx, body: Body) -> ProcedureFuture<'cx>

Handles a procedure call, deserializing its arguments from body.

Trait Implementations§

Source§

impl Collect for &'static dyn Procedure

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<P: Procedure + ?Sized> Procedure for &'static P

Source§

fn id(&self) -> ProcedureId

Source§

fn handle<'cx>(&'cx self, cx: &'cx Cx, body: Body) -> ProcedureFuture<'cx>

Implementors§