From 658fb86be6090aa7567dc306fd01d4112f093d8d Mon Sep 17 00:00:00 2001 From: Fangdun Tsai Date: Sat, 13 Jan 2024 06:49:25 +0800 Subject: [PATCH] bump: v0.7.2 --- Cargo.toml | 10 ++--- viz-smol/README.md | 97 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 5 deletions(-) create mode 100644 viz-smol/README.md diff --git a/Cargo.toml b/Cargo.toml index 997d241e..81a29ebe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ members = [ ] [workspace.package] -version = "0.7.1" +version = "0.7.2" authors = ["Fangdun Tsai "] edition = "2021" homepage = "https://viz.rs" @@ -49,10 +49,10 @@ license = "MIT" rust-version = "1.75" [workspace.dependencies] -viz = { version = "0.7.1", path = "viz" } -viz-core = { version = "0.7.1", path = "viz-core" } -viz-router = { version = "0.7.1", path = "viz-router" } -viz-handlers = { version = "0.7.1", path = "viz-handlers", default-features = false } +viz = { version = "0.7.2", path = "viz" } +viz-core = { version = "0.7.2", path = "viz-core" } +viz-router = { version = "0.7.2", path = "viz-router" } +viz-handlers = { version = "0.7.2", path = "viz-handlers", default-features = false } viz-macros = { version = "0.2.0", path = "viz-macros" } viz-test = { version = "0.2.0", path = "viz-test" } viz-tower = { version = "0.1.0", path = "viz-tower" } diff --git a/viz-smol/README.md b/viz-smol/README.md new file mode 100644 index 00000000..def81583 --- /dev/null +++ b/viz-smol/README.md @@ -0,0 +1,97 @@ +

+ +

+ +

+ Viz +

+ +
+

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 Viz + +```rust +use std::io; +use std::sync::Arc; + +use async_net::TcpListener; +use macro_rules_attribute::apply; +use viz_smol::{Request, Result, Router}; + +async fn index(_: Request) -> Result<&'static str> { + Ok("Hello, Viz!") +} + +#[apply(smol_macros::main!)] +async fn main(ex: &Arc>) -> 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 + viz_smol::serve(ex.clone(), listener, app).await +} +``` + +More examples can be found +[here](https://github.com/viz-rs/viz/tree/main/examples). + +## Get started + +Open [Viz.rs](https://viz.rs), select language or version. + +## License + +This project is licensed under the [MIT license](LICENSE). + +## Author + +- [@fundon@fosstodon.org](https://fosstodon.org/@fundon) + +- [@\_fundon](https://twitter.com/_fundon)