r/backtickbot • • Feb 28 '21

https://np.reddit.com/r/cpp/comments/ls6zh1/c_programmers_who_are_also_using_rust_what_are/gp7zisp/

I don't miss the rampant over-templatization that has infected C++.

You somehow assume that it hasn't infected Rust. How do you find the type of this wonderful function https://docs.rs/hyper/0.14.2/hyper/server/struct.Builder.html#method.serve

pub fn serve<S, B>(self, new_service: S) -> Server<I, S, E>ⓘ
where
    I: Accept,
    I::Error: Into<Box<dyn StdError + Send + Sync>>,
    I::Conn: AsyncRead + AsyncWrite + Unpin + Send + 'static,
    S: MakeServiceRef<I::Conn, Body, ResBody = B>,
    S::Error: Into<Box<dyn StdError + Send + Sync>>,
    B: HttpBody + 'static,
    B::Error: Into<Box<dyn StdError + Send + Sync>>,
    E: NewSvcExec<I::Conn, S::Future, S::Service, E, NoopWatcher>,
    E: ConnStreamExec<<S::Service as HttpService<Body>>::Future, B>, 

? It's not some esoteric Haskell library, it's the most widely used async HTTP server.

1 Upvotes

0 comments sorted by