mini-static 0.5.0

A secure, async static file server with streaming, traversal protection, and connection limits.
Documentation
1
2
3
4
5
6
7
8
9
use bytes::Bytes;

/// The response body type used by mini-static.
///
/// This is a boxed HTTP body containing bytes. The error type is `StaticError` rather
/// than `Infallible` because streamed file bodies can fail mid-stream (e.g. a disk read
/// error after headers have already been sent) — that failure has to be representable
/// by the body's `Error` type, not just by whatever produced the initial `Response`.
pub type ResponseBody = http_body_util::combinators::BoxBody<Bytes, crate::error::StaticError>;