From 5a207c6649a67871c209f8e1634efcbcc719bee6 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 4 Jul 2020 15:33:59 +0200 Subject: Add documentation Write doc comments for functions and types, and include a short example. --- src/lib.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 2ffe77e..caf8663 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,35 @@ +#![warn(missing_docs)] + +//! # fastcgi-conduit +//! +//! FastCGI-Conduit provides a [Conduit] interface to FastCGI, enabling a +//! high-level API for FastCGI applications. +//! +//! +//! ## Example +//! +//! ``` rust +//! use conduit::{header, Body, RequestExt, Response}; +//! use fastcgi_conduit::Server; +//! +//! +//! fn main() { +//! Server::start(handler).unwrap(); +//! } +//! +//! fn handler(_req: &mut dyn RequestExt) -> std::io::Result> { +//! Ok( +//! Response::builder() +//! .header(header::CONTENT_TYPE, "text/html") +//! .body(Body::from_static(b"

Hello

")) +//! .unwrap() +//! ) +//! } +//! ``` +//! +//! +//! [Conduit]: ../conduit/index.html + extern crate conduit; extern crate fastcgi; extern crate http; -- cgit v1.2.3