Waiiiit, if we can return closures from functions now - creating middleware should be a lot easier: ``` fn main () { for conn in server { let timer_done = timer(); /* run server code */ timer_done(); } } ``` Maybe with Drop semantics this can be even better?
-
Show this thread
-
Whenever talking about middleware, I always think about Koa. It's cool because they allowed for pushing things up the stack, and on the way back things would unwind. I wonder what a good way might be to achieve the same semantics in Rust. I'm thinking maybe Drop, but erorrs :/
2 replies 0 retweets 1 likeShow this thread
Btw, this is the same idea executed in ES5. https://github.com/yoshuawuyts/nanostack#how-does-this-work … Wondering how to achieve this in Rust.
0 replies
0 retweets
3 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.