The Evolution of Rust Web Frameworks: From Niche to Mainstream

Introduction

As of 2025, Rust has become an undeniable force in the field of web development. But did you know that just a few years ago, Rust was merely a “niche player” in this domain? A developer named Loïc Labeye, who has been using Rust since 2020, recently shared his observations and thoughts on the evolution of Rust web frameworks. Let’s follow his perspective to see how Rust has made a remarkable comeback in web development.

The Early Years of Rust: A Steep but Worthwhile Learning Curve

In 2020, the Rust community, although small, was already very active and welcoming. For developers transitioning from a Java background, the biggest challenge was understanding the concept of ownership. At first glance, this concept may seem burdensome, but upon deeper understanding, it becomes the cornerstone of Rust’s safety.

At that time, asynchronous programming had just emerged about a year prior, and actix-web was the primary framework for HTTP operations. Although the learning curve was steep, once your program compiled successfully, it would run reliably—this was a stark contrast to Java or Python.

// A simple example of early actix-web
use actix_web::{web, App, HttpResponse, HttpServer};

async fn hello() -> HttpResponse {
    HttpResponse::Ok().body("Hello, Rust Web!")
}

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| {
        App::new()
            .route("/", web::get().to(hello))
    })
    .bind("127.0.0.1:8080")?
    .run()
    .await
}

The Three Pillars of Rust’s Success

1. A Strict but Intelligent Compiler

The Rust compiler does not “tolerate” your mistakes. It points out every piece of code that could lead to bugs until you fix them. This “strictness” has become an advantage for Rust—programs that compile successfully rarely encounter runtime errors.

2. A Powerful Package Manager: Cargo

Cargo simplifies dependency management; although upgrading dependencies can be somewhat cumbersome, dependency conflicts can theoretically be handled automatically in the background.

3. An Excellent Documentation System

Rust’s documentation system, rustdoc, is well-designed and can even test code examples in the documentation at compile time. Once you get used to the quality of Rust’s documentation, you may find it hard to adjust to the documentation of other languages.

Axum: A Game-Changing Web Framework

In 2020, despite Rust being named “the most loved language” for several years, its application in actual web development was still limited. Unless you were writing CLI tools or TUI applications, few would recommend using Rust for web development—after all, Go could achieve the same functionality in a more straightforward manner.

Everything changed with the emergence of Axum. This REST-first framework is seen as a replacement for actix-web, making it simple and direct to create APIs with complex middleware. Thanks to Rust’s strong type system and compiler checks, quickly creating reliable REST APIs has not only become possible but also enjoyable.

// Axum framework example: Creating a simple REST API
use axum::{
    routing::{get, post},
    http::StatusCode,
    Json, Router,
};
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
struct User {
    id: u32,
    name: String,
}

// Handler function to get user information
async fn get_user() -> Json<user> {
    Json(User {
        id: 1,
        name: "Alice".to_string(),
    })
}

// Handler function to create a user
async fn create_user(Json(user): Json<user>) -> StatusCode {
    // Logic to save the user can be added here
    println!("Creating user: {}", user.name);
    StatusCode::CREATED
}

#[tokio::main]
async fn main() {
    // Build the router
    let app = Router::new()
        .route("/user", get(get_user))
        .route("/user", post(create_user));

    // Start the server
    axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
        .serve(app.into_make_service())
        .await
        .unwrap();
}
</user></user>

Cargo Lambda: Rust in the Cloud Era

In the early 2020s, cloud solutions were widely adopted by enterprises, but Rust lagged in this area. Although it was already possible to deploy Rust as a custom runtime to AWS Lambda, it required considerable expertise and was not convenient.

The introduction of Cargo Lambda changed this situation. After its stable release at the end of November 2023, it quickly gained attention. Now, packaging Rust applications for AWS Lambda has become exceptionally simple:

# Initialize a new Lambda function
$ cargo lambda init test

# The system will prompt you to choose the function type and event type
> Is this function an HTTP function? No
? Event type that this function receives
  activemq::ActiveMqEvent
  autoscaling::AutoScalingEvent
  bedrock_agent_runtime::AgentEvent
  ...

Cargo Lambda provides a wealth of predefined templates, so no matter what you want to do on AWS, you can find a corresponding template to accelerate development. More importantly, considering Rust’s high performance and extremely short cold start times, using Rust to develop cloud functions could save enterprises considerable costs—after all, in the cloud, the shorter the program run time, the lower the costs.

// A simple Lambda function example created with cargo-lambda
use lambda_runtime::{run, service_fn, Error, LambdaEvent};
use serde::{Deserialize, Serialize};

#[derive(Deserialize)]
struct Request {
    name: String,
}

#[derive(Serialize)]
struct Response {
    message: String,
}

async fn function_handler(event: LambdaEvent<request>) -> Result<response, error=""> {
    // Extract request data from the event
    let name = event.payload.name;
    
    // Construct the response
    let response = Response {
        message: format!("Hello, {}! This is a greeting from Rust Lambda", name),
    };
    
    Ok(response)
}

#[tokio::main]
async fn main() -> Result<(), Error> {
    tracing_subscriber::fmt()
        .with_max_level(tracing::Level::INFO)
        .with_target(false)
        .without_time()
        .init();

    run(service_fn(function_handler)).await
}
</response,></request>

Conclusion

The future of Rust in the web technology field is bright. From a steep learning curve as a niche language to having excellent web frameworks like Axum, and now achieving convenient cloud deployment through Cargo Lambda, Rust has made a stunning transformation in the web development arena.

Now, running Rust in the cloud has become so convenient that more and more enterprises are likely to seek developers proficient in Rust to migrate critical workloads to this language. After all, Rust not only offers better performance but also requires less boilerplate code and ensures that “what you write is what you run.”

The only challenge may be the scarcity of Rust developers—but for those willing to learn Rust, this presents an opportunity. If you are considering learning a new programming language or seeking breakthroughs in web development, now might be the best time to embrace Rust.

References

  1. My opinion on Rust’s web frameworks evolution over the past years: https://medium.com/@loic.labeye/my-opinion-on-rusts-web-frameworks-evolution-over-the-past-years-ce08186c7d55
  2. Axum official documentation: https://docs.rs/axum/latest/axum/
  3. Cargo Lambda project address: https://github.com/cargo-lambda/cargo-lambda

Book Recommendations

The second edition of “The Rust Programming Language” is an authoritative learning resource written by the Rust core development team and translated by members of the Chinese Rust community. It is suitable for all software developers who wish to evaluate, get started, improve, and research the Rust language, and is regarded as essential reading for Rust development work.

This book introduces the fundamental concepts of the Rust language to unique practical tools, covering advanced concepts such as ownership, traits, lifetimes, and safety guarantees, as well as practical tools like pattern matching, error handling, package management, functional features, and concurrency mechanisms. The book includes three complete project development case studies, guiding readers from zero to developing practical Rust projects.

Notably, this book has been updated to include content from the Rust 2021 edition, meeting the systematic learning needs of beginners while also serving as a reference guide for experienced developers, making it the best entry point for building solid Rust skills.

Recommended Reading

  1. Rust: The Performance King Sweeping C/C++/Go?

  2. A C++ Perspective from a Rust Developer: Revealing Pros and Cons

  3. Rust vs Zig: The Battle of Emerging System Programming Languages

  4. Essential Design Patterns for Rust Asynchronous Programming: Enhancing Your Code Performance and Maintainability

Leave a Comment