I kind of wish Tide's endpoint signature was: asycn fn(req: Request<State>) -> Result<Response>; Where Request: AsyncRead and Response: AsyncRead. We could then move on to define specialized shorthands from there.
By "specialize" I mean: define trait impls so we could keep writing: http://app.at ("/").get(|_| "hello world");
-
-
Another fun definition: if we had From<Request> for Response, then an HTTP echo server could be defined as: http://app.at ("/").get(|req| req); I was trying to make this work today, and ooophhh. Getting this to work in a streaming fashion is not straight forward.
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
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.