fn oxl_around
The lowering of a handler with user attributes (ServiceSema.cpp): oxl_around(Attr{…}, () => { body }).
Example:
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, dbSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
mw | M |
body | fn() -> R F |
Returns
R
Errors
NetError- the `NetError` a middleware refuses with.
Effects
net, io, time, db
Defined in: std/core/rpc.oxl:572