vidi-smol

Crates.iovidi-smol
lib.rsvidi-smol
version0.1.0
created_at2025-12-06 20:21:44.584662+00
updated_at2025-12-06 20:21:44.584662+00
descriptionAn adapter for smol runtime
homepagehttps://vidi.viz.rs
repositoryhttps://github.com/viz-rs/vidi
max_upload_size
id1970711
size55,273
Fangdun Tsai (fundon)

documentation

https://docs.rs/vidi-smol

README

Vidi

Fast, robust, flexible, lightweight web framework for Rust

Safety! Docs.rs docs Crates.io version Download Codecov Discord

Features

  • Safety #![forbid(unsafe_code)]

  • Lightweight

  • Robust Routing

  • Handy Extractors

  • Simple + Flexible Handler & Middleware

  • Supports Tower Service

Hello Vidi

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.

Get started

Open Vidi, select language or version.

License

This project is licensed under the MIT license.

Author

Commit count: 0

cargo fmt