Which Rust web framework to choose in 2022 (with code examples)

This page summarizes the projects mentioned and recommended in the original post on dev.to

Nutrient - The #1 PDF SDK Library
Bad PDFs = bad UX. Slow load times, broken annotations, clunky UX frustrates users. Nutrient’s PDF SDKs gives seamless document experiences, fast rendering, annotations, real-time collaboration, 100+ features. Used by 10K+ devs, serving ~half a billion users worldwide. Explore the SDK for free.
nutrient.io
featured
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
  1. hyper

    An HTTP library for Rust (by hyperium)

    My heart goes to axum. I find it has the cleanest API, it is built on top of hyper, which is (certainly) the most tested and reliable HTTP stack in Rust, and because it is developed by tokio's team.

  2. Nutrient

    Nutrient - The #1 PDF SDK Library. Bad PDFs = bad UX. Slow load times, broken annotations, clunky UX frustrates users. Nutrient’s PDF SDKs gives seamless document experiences, fast rendering, annotations, real-time collaboration, 100+ features. Used by 10K+ devs, serving ~half a billion users worldwide. Explore the SDK for free.

    Nutrient logo
  3. Tide

    Fast and friendly HTTP server framework for async Rust

    tide

  4. Rouille, Rust web server middleware

    Web framework in Rust (by tomaka)

    rouille

  5. Iron

    An Extensible, Concurrent Web Framework for Rust

    iron

  6. tower

    async fn(Request) -> Result<Response, Error>

    #[derive(Clone)] struct MyMiddleware { inner: S, } impl Service> for MyMiddleware where S: Service, Response = Response> + Clone + Send + 'static, S::Future: Send + 'static, { type Response = S::Response; type Error = S::Error; type Future = BoxFuture<'static, Result>; fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { self.inner.poll_ready(cx) } fn call(&mut self, mut req: Request) -> Self::Future { println!("before"); // best practice is to clone the inner service like this // see https://github.com/tower-rs/tower/issues/547 for details let clone = self.inner.clone(); let mut inner = std::mem::replace(&mut self.inner, clone); Box::pin(async move { let res: Response = inner.call(req).await?; println!("after"); Ok(res) }) } } fn main() { let app = Router::new() .route("/", get(|| async { /* ... */ })) .layer(layer_fn(|inner| MyMiddleware { inner })); }

  7. bloom

    The simplest way to de-Google your life and business: Inbox, Calendar, Files, Contacts & much more (by skerkour)

    For larger projects, I think that actix-web is the incontestable winner. That's why it's my choice for Bloom.

  8. black-hat-rust

    Applied offensive security with Rust - https://kerkour.com/black-hat-rust

    Want to learn Rust, Cybersecurity and applied Cryptography? Take a look at my book Black Hat Rust!

  9. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Ask HN: Anyone using Rust for server side application development?

    8 projects | news.ycombinator.com | 20 Aug 2022
  • Extension Maps in Rust

    5 projects | /r/rust | 6 Jan 2022
  • New crate: asserhttp

    7 projects | /r/rust | 23 Nov 2021
  • Zero Trust at the Edge (part 1)

    1 project | dev.to | 3 Feb 2025
  • PEP and PDP for Secure Authorization with Cognito

    1 project | dev.to | 3 Feb 2025