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, dbС версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
mw | M |
body | fn() -> R F |
Возвращает
R
Ошибки
NetError- the `NetError` a middleware refuses with.
Эффекты
net, io, time, db
Определено в: std/core/rpc.oxl:572