Crates.io | hsr |
lib.rs | hsr |
version | 0.4.0 |
source | src |
created_at | 2019-08-14 11:03:51.252864 |
updated_at | 2022-11-10 10:45:22.382744 |
description | Build fast HTTP APIs fast, with Rust + OpenAPI |
homepage | https://github.com/adwhit/hsr |
repository | https://github.com/adwhit/hsr |
max_upload_size | |
id | 156729 |
size | 6,546 |
Build fast HTTP apis fast, with Rust, and OpenAPI
Take a look at the quickstart example. It contains the minimum boilerplate needed to get up and running.
Read the tutorial for a step-by-step guide to get up and running.
Take a look at the petstore example for a more complex example with a mocked database backend.
async/await
and actix-web 4.2.1
What's the difference between this and swagger-rs?
I haven't used swagger-rs
, however the major difference is that hsr
is pure Rust,
whereas swagger-rs
takes advantage of an existing code-generator written in Java.
That means that the swagger-rs
is more mature likely much more correct,
hsr
is much easier to use and is seamlessly integrated into typical Rust workflow.
What do you mean, 'fast'?
It uses Actix-Web under the hood, rated as one of the
fastest web frameworks by techempower.
hsr
imposes very little overhead on top.
As a simple and not-very-scientific benchmark, on my laptop (X1 Carbon 6th Gen) I measured around:
Try it yourself! See the bench example.
Why the name?
I like fast trains.
MIT