Expand description

Windmark

crates.io docs.rs github.com

Windmark is an elegant and highly performant, async Gemini server framework.

Usage

Add Windmark as a dependency


[dependencies]
windmark = "0.1.4"
tokio = { version = "0.2.4", features = ["full"] }

Implement a Windmark server

// src/main.rs

use windmark::Response;

#[windmark::main]
fn main() -> Result<(), Box<dyn std::error::Error>> {
  windmark::Router::new()
    .set_private_key_file("windmark_private.pem")
    .set_certificate_chain_file("windmark_pair.pem")
    .mount("/", Box::new(|_| Response::Success("Hello, World!".into())))
    .set_error_handler(Box::new(|_| {
      Response::PermanentFailure("This route does not exist!".into())
    }))
    .run()
    .await
}

Examples

Examples can be found within the examples/ directory.

License

This project is licensed with the GNU General Public License v3.0.

Re-exports

pub use response::Response;

Modules

Content and response handlers

Utilities to make cumbersome tasks simpler

Structs

A router which takes care of all tasks a Windmark server should handle: response generation, panics, logging, and more.

Attribute Macros

Marks async function to be executed by selected runtime. This macro helps set up a Runtime without requiring the user to use Runtime or Builder directly.