Crates.io | rohanasan |
lib.rs | rohanasan |
version | 0.5.47 |
source | src |
created_at | 2024-03-17 12:08:20.80315 |
updated_at | 2024-04-23 08:18:40.070262 |
description | An extremely fast backend framework for rust! Built from scratch using tokio, easy to use and asynchronous. Available for multiple programming languages and cross-platform. |
homepage | |
repository | https://github.com/rohanasan/rohanasan-rs |
max_upload_size | |
id | 1176413 |
size | 669,799 |
Made with Performance, optimization and ease of use in mind.
Currently available in C/C++/Rust programming languages only.
This library has been built from scratch using tokio.
Basic Html implementation of hello world:
use rohanasan::{
rohanasan, send_http_response, serve, Request, DEFAULT_HTML_HEADER,
};
fn handle(req: Request) -> String {
send_http_response(DEFAULT_HTML_HEADER, "<h1>Hello!</h1>", req)
}
fn main() {
rohanasan! {
serve(8080, handle)
}
}
cargo install rohanasanpm
rohanasanpm new my_proj
cd
into my_projcargo run
to run your project.localhost:8080
.git clone https://github.com/rohanasan/rohanasan-rs.git
cd rohanasan-rs
cd examples
cargo run --example standard
OS: Garuda Linux x86_64
Laptop: Dell Inspiron 5590
Kernel: 6.8.1-zen1-1-zen
Mode: GUI mode (terminal was running like a window)
Shell: fish 3.7.0
Terminal: konsole 24.2.1
CPU: Intel(R) Core(TM) i3-10110U (4) @ 4.10 GHz
GPU: Intel UHD Graphics (The CPU itself)
Memory: 11.47 GiB
Command used to run test: wrk -t 2 -c 100 http://localhost:8080
Thread Stats | Avg | Stdev | Max | +/- Stdev |
---|---|---|---|---|
Latency | 844.10us | 480.14us | 4.14ms | 64.85% |
Req/Sec | 26.24k | 831.40 | 28.10k | 70.00% |
Output: 522523 requests in 10.02s, 46.84MB read
Requests/sec: 52142.29
Transfer/sec: 4.67MB
Program that was run: examples/hello_world.rs
request.post_request()
Please support rohanasan: https://www.buymeacoffee.com/rohanvashisht
Please star rohanasan's github repo: https://github.com/rohanasan/rohanasan-rs
Basic Html implementation of hello world:
use rohanasan::{
rohanasan, send_file, serve, Request, DEFAULT_HTML_HEADER,
};
fn handle(req: Request) -> String {
send_file(DEFAULT_HTML_HEADER, "./html/index.html", req)
}
fn main() {
rohanasan! {
serve(8080, handle)
}
}