type Next
The rest of the chain as seen by a middleware: the next middleware and finally the router's own dispatch.
Same name and call shape (next(x)) as std.rpc.Next of the rpc middleware (§10.2), D-3995.
Example:
use std.http { Next, Request, Reply, Middleware }
// a middleware calls `next(req)` to continue the chain
fn tag(req: Request, next: Next) -> Reply net, io, time {
next(req).withHeader("X-Tagged", "yes")
}
fn main() io {
let mw: Middleware = tag
print("ok")
}Output
ok
pub(api) type Next = fn(Request) -> Reply net, io, timeSince. 1.0.0-beta
Defined in: std/http/http.oxl:3038