method Middleware.around
Wraps every call of the rpc the attribute is written on: runs code before and after next(ctx), or refuses the call with Response.refuse(e) without calling next.
Example:
attr Timed {}
impl Middleware for Timed {
fn around(ctx: &var Ctx, next: Next) -> Response net, io, time, db {
let t0 = Instant.now()
let r = next(ctx)
print("took {t0.elapsed().millis()} ms")
r
}
}fn around(ctx: &var Ctx, next: Next) -> Response net, io, time, dbС версии. 1.0.0-beta
Параметры
Возвращает
Эффекты
net, io, time, db
Определено в: std/core/rpc.oxl:542