Crate mini_http [] [src]

mini_http

Basic Example

mini_http::Server::new("127.0.0.1:3002")?
    .start(|request| {
        mini_http::Response::builder()
            .status(200)
            .body(b"Hello!\n".to_vec())
            .unwrap()
    })?;

Note: If you're experiencing poor performance on benchmarks, see tcp_nodelay

Modules

header

HTTP header types

method

The HTTP request method

response

HTTP response types.

status

HTTP status codes

uri

URI component of request and response lines

version

HTTP version

Structs

Error

The Error type.

Request

Request received and used by handlers. Wraps & derefs to an http::Request and patches Request::body to return the correct slice of bytes from the HttpStreamReader.read_buf

Response

Represents an HTTP response

Server

Enums

ErrorKind

The kind of an error.

Traits

ResultExt

Additional methods for Result, for easy interaction with this crate.

Type Definitions

Result

Convenient wrapper around std::Result.