OxL Reference

type Next

The rest of the chain: the next middleware and finally the handler. Run it with the context you hold (next(ctx)).

Example:

oxl✓ checked in CI
attr Logged {}

impl Middleware for Logged {
  fn around(ctx: &var Ctx, next: Next) -> Response net, io, time, db {
    print("before")
    let r = next(ctx)
    print("after")
    r
  }
}
pub(api) type Next = fn(&var Ctx) -> Response net

Since. 1.0.0-beta

Defined in: std/core/rpc.oxl:497

See also