OxL Reference

fn oxl_around

The lowering of a handler with user attributes (ServiceSema.cpp): oxl_around(Attr{…}, () => { body }).

Example:

oxl✓ checked in CI
attr Counted {}

impl Middleware for Counted {
  fn around(ctx: &var Ctx, next: Next) -> Response net, io, time, db {
    next(ctx)
  }
}

service Echo {
  @public @Counted rpc say(text: str) -> str
}

impl Echo {
  rpc say(text) => text
}
pub(api) fn oxl_around<M: Middleware, R, effect F>(mw: M, body: fn() -> R F) -> R | NetError  net, io, time, db

Since. 1.0.0-beta

Parameters

NameType
mwM
bodyfn() -> R F

Returns

R

Errors

  • NetError
  • the `NetError` a middleware refuses with.

Effects

net, io, time, db

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

See also