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

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • 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.

  • Tide

    Fast and friendly HTTP server framework for async Rust

  • tide

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • Rouille, Rust web server middleware

    Web framework in Rust (by tomaka)

  • rouille

  • Iron

    An Extensible, Concurrent Web Framework for Rust

  • iron

  • 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 })); }

  • 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.

  • 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!

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub 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
  • Show HN: Storing Private Keys in the Browser Securely

    2 projects | news.ycombinator.com | 23 Apr 2024
  • Authentication using JSON Web Tokens.

    1 project | dev.to | 11 Apr 2024