darkdarkfruit / gotham

A flexible web framework that promotes stability, safety, security and speed.

Home Page:https://gotham.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The Gotham web framework

A flexible web framework that promotes stability, safety, security and speed.

Join the chat at https://gitter.im/gotham-rs/gotham GitHub actions Dependency status

Additional feature of this fork:

  • Support Borrowing Async Request Handlers(route: to_async_borrowing) by customizing error response (.await version), so you can use ? shorthand.
  • example usage:
pub async fn might_return_error_by_mapping_err_with_customized_response(
    state: &mut State,
) -> Result<impl IntoResponse, HandlerError> {
    let even = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs() % 2;

    if even == 0 {
        // here, we just simulate an err.
        let _io_error = Err(std::io::Error::last_os_error())
                |_state| {
                    // an error occurs, but still sending **OK** to client
                    (StatusCode::SERVICE_UNAVAILABLE, mime::TEXT_PLAIN_UTF_8, "Error: Customized response by the last os error (Intentionally return 200 even error occurs) (even == 0)")
    Ok(create_response(&state, StatusCode::OK, mime::TEXT_PLAIN_UTF_8, "even != 0"))
  • see more examples at: examples/handlers/simple_async_handlers_await_with_customized_error_response/src/main.rs

This example shows how to customizing error response when different errors occur.What is this fork includes


  1. Stability focused. All releases target stable Rust. This will never change. To ensure future compatibility, we also run automated builds against Rust beta and nightly releases.
  2. Statically typed. The Gotham web framework is statically typed ensuring your application is correctly expressed at compile time.
  3. Async everything. By leveraging the Tokio project, all Gotham web framework types are async out of the box. Our async story is further enhanced by Hyper, a fast server that provides an elegant layer over stringly typed HTTP.
  4. Blazingly fast. Measure completed requests, including the 99th percentile, in µs.


Licensed under your option of:


The following policies guide participation in our project and our community:


The following resources are available to assist you learning the Gotham web framework:

Projects Using Gotham


We hope you'll find the Gotham web framework is flexible enough to meet the needs of any web application you might like to build. Please have a chat with us or create an issue if you find this isn't the case, perhaps there is something the Gotham web framework can offer that will help you achieve your goals.

We do acknowledge that sometimes the choices we've made for the Gotham web framework may not suit the needs of all projects. If that is the case for your project there are alternative Rust web frameworks you might like to consider:

  1. Actix-Web
  2. Conduit
  3. Nickel
  4. Rocket
  5. Rouille

Explore even more suggestions at Are we web yet?.


A flexible web framework that promotes stability, safety, security and speed.




Language:Rust 99.9%Language:Shell 0.1%Language:HTML 0.0%Language:JavaScript 0.0%Language:CSS 0.0%