submillisecond 0.3.0

A lunatic web framework for Rust.
Documentation
//! Submillisecond is a [lunatic](https://lunatic.solutions/) web framework.
//!
//! # Usage
//!
//! First, add `submillisecond` as a dependency in `Cargo.toml`:
//!
//! ```toml
//! [dependencies]
//! submillisecond = "0.1"
//! ```
//!
//! Then, add a `.cargo/config.toml` to configure the target and runner:
//!
//! ```toml
//! [build]
//! target = "wasm32-wasi"
//!
//! [target.wasm32-wasi]
//! runner = "lunatic"
//! ```
//!
//! Finally, define a [handler](crate::Handler) and
//! [router](crate::router), and run your application:
//!
//! ```
//! use submillisecond::{router, Application};
//!
//! fn index() -> &'static str {
//!     "Hello from Submillisecond!"
//! }
//!
//! fn main() -> std::io::Result<()> {
//!     Application::new(router! {
//!         GET "/" => index
//!     })
//!     .serve("0.0.0.0:3000")
//! }
//! ```
//!
//! The submillisecond repository has some more [examples](https://github.com/lunatic-solutions/submillisecond/tree/main/examples) to help you get started.
//!
//! # High-level features
//!
//! Submillisecond has some notable features including:
//!
//! - [Router macro](crate::router) for performant router generated at
//!   compile-time.
//! - [Handlers](crate::Handler): functions taking any number of extractors and
//!   returning any type that implements
//!   [IntoResponse](crate::response::IntoResponse).
//! - [Extractors](crate::extract::FromRequest): types that parse the request to
//!   provide useful data.
//! - Middleware: any handler which calls
//!   [`req.next_handler()`](crate::RequestContext::next_handler).
//! - [Guards](crate::Guard): types that protect routes per request.

#![warn(missing_docs)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

pub use submillisecond_macros::*;
pub use {headers, http};

pub use crate::app::Application;
pub use crate::core::Body;
pub use crate::error::*;
pub use crate::guard::*;
pub use crate::handler::*;
#[cfg(feature = "json")]
pub use crate::json::*;
pub use crate::request::*;
use crate::response::Response;
pub use crate::typed_header::*;

#[macro_use]
pub(crate) mod macros;

#[cfg(feature = "cookies")]
pub mod cookies;
pub mod defaults;
pub mod extract;
pub mod params;
pub mod reader;
pub mod response;
#[cfg(feature = "cookies")]
pub mod session;
pub mod state;
#[cfg(feature = "template")]
pub mod template;
#[cfg(feature = "websocket")]
pub mod websocket;

mod app;
mod core;
mod error;
mod guard;
mod handler;
#[cfg(feature = "json")]
mod json;
mod request;
mod supervisor;
mod typed_header;

/// Signature of router function generated by the [`router!`] macro.
pub type Router = fn() -> fn(RequestContext) -> Response;