| Crates.io | vidi-smol |
| lib.rs | vidi-smol |
| version | 0.1.0 |
| created_at | 2025-12-06 20:21:44.584662+00 |
| updated_at | 2025-12-06 20:21:44.584662+00 |
| description | An adapter for smol runtime |
| homepage | https://vidi.viz.rs |
| repository | https://github.com/viz-rs/vidi |
| max_upload_size | |
| id | 1970711 |
| size | 55,273 |
Fast, robust, flexible, lightweight web framework for Rust
Safety #![forbid(unsafe_code)]
Lightweight
Robust Routing
Handy Extractors
Simple + Flexible Handler & Middleware
Supports Tower Service
use std::io;
use std::sync::Arc;
use async_net::TcpListener;
use macro_rules_attribute::apply;
use vidi_smol::{IntoResponse, Request, Response, Result, Router};
async fn index(_: Request) -> Result<Response> {
Ok("<h1>Hello, World!</h1>".into_response())
}
#[apply(smol_macros::main!)]
async fn main(ex: &Arc<smol_macros::Executor<'_>>) -> io::Result<()> {
// Build our application with a route.
let app = Router::new().get("/", index);
// Create a `smol`-based TCP listener.
let listener = TcpListener::bind(("127.0.0.1", 3000)).await.unwrap();
println!("listening on {}", listener.local_addr().unwrap());
// Run it
vidi_smol::serve(ex.clone(), listener, app).await
}
More examples can be found here.
Open Vidi, select language or version.
This project is licensed under the MIT license.