···1515# Cargo.toml
16161717[dependencies]
1818-windmark = "0.1.14"
1818+windmark = "0.1.15"
1919tokio = { version = "0.2.4", features = ["full"] }
20202121# If you would like to use the built-in logger (recommended)
2222-# windmark = { version = "0.1.14", features = ["logger"] }
2222+# windmark = { version = "0.1.15", features = ["logger"] }
23232424# If you would like to use the built-in MIME dedection when `Success`-ing a file
2525# (recommended)
2626-# windmark = { version = "0.1.14", features = ["auto-deduce-mime"] }
2626+# windmark = { version = "0.1.15", features = ["auto-deduce-mime"] }
2727```
28282929### Implement a Windmark server
+8-84
src/lib.rs
···1616// Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
1717// SPDX-License-Identifier: GPL-3.0-only
18181919-//! # Windmark
2020-//!
2121-//! [](https://crates.io/crates/windmark)
2222-//! [](https://docs.rs/windmark)
2323-//! [](https://github.com/gemrest/windmark/actions/workflows/check.yaml)
2424-//!
2525-//! Windmark is an elegant and highly performant, async Gemini server framework
2626-//! for the modern age!
2727-//!
2828-//! ## Usage
2929-//!
3030-//! ### Add Windmark as a dependency
3131-//!
3232-//! ```toml
3333-//! # Cargo.toml
3434-//!
3535-//! [dependencies]
3636-//! windmark = "0.1.14"
3737-//! tokio = { version = "0.2.4", features = ["full"] }
3838-//!
3939-//! # If you would like to use the built-in logger (recommended)
4040-//! # windmark = { version = "0.1.14", features = ["logger"] }
4141-//!
4242-//! # If you would like to use the built-in MIME dedection when `Success`-ing a file
4343-//! # (recommended)
4444-//! # windmark = { version = "0.1.14", features = ["auto-deduce-mime"] }
4545-//! ```
4646-//!
4747-//! ### Implement a Windmark server
4848-//!
4949-//! ```rust
5050-//! // src/main.rs
5151-//!
5252-//! use windmark::Response;
5353-//!
5454-//! #[windmark::main]
5555-//! fn main() -> Result<(), Box<dyn std::error::Error>> {
5656-//! windmark::Router::new()
5757-//! .set_private_key_file("windmark_private.pem")
5858-//! .set_certificate_chain_file("windmark_public.pem")
5959-//! .mount("/", Box::new(|_| Response::Success("Hello, World!".into())))
6060-//! .set_error_handler(Box::new(|_| {
6161-//! Response::PermanentFailure("This route does not exist!".into())
6262-//! }))
6363-//! .run()
6464-//! .await
6565-//! }
6666-//! ```
6767-//!
6868-//! ## Examples
6969-//!
7070-//! Examples can be found within the
7171-//! [`examples/`](https://github.com/gemrest/windmark/tree/main/examples) directory.
7272-//!
7373-//! An example of a fully featured Gemini capsule written using Windmark can be
7474-//! found [here](https://github.com/gemrest/locus). This example Gemini capsule also
7575-//! happens to be the source code for [Fuwn's](https://github.com/Fuwn) (this
7676-//! library's author) personal Gemini capsule!
7777-//!
7878-//! ## Modules
7979-//!
8080-//! Modules are reusable extensions which can be procedurally mounted onto
8181-//! Windmark routers.
8282-//!
8383-//! [Add yours!](https://github.com/gemrest/windmark/edit/main/README.md)
8484-//!
8585-//! - [Windmark Comments](https://github.com/gemrest/windmark-comments)
8686-//!
8787-//! ## Capsules using Windmark
8888-//!
8989-//! [Add yours!](https://github.com/gemrest/windmark/edit/main/README.md)
9090-//!
9191-//! - <https://fuwn.me/>
9292-//!
9393-//! ## License
9494-//!
9595-//! This project is licensed with the
9696-//! [GNU General Public License v3.0](https://github.com/gemrest/windmark/blob/main/LICENSE).
9797-9819#![feature(once_cell, fn_traits)]
9920#![deny(
100100- warnings,
2121+ clippy::all,
2222+ clippy::nursery,
2323+ clippy::pedantic,
2424+ future_incompatible,
10125 nonstandard_style,
2626+ rust_2018_idioms,
2727+ unsafe_code,
10228 unused,
103103- future_incompatible,
104104- rust_2018_idioms,
105105- unsafe_code
2929+ warnings
10630)]
107107-#![deny(clippy::all, clippy::nursery, clippy::pedantic)]
3131+#![doc = include_str!("../README.md")]
10832#![recursion_limit = "128"]
1093311034pub mod handler;