Crate mini_server

Source

Modules§

worker

Macros§

expand
Get the value of a path dynamic variable
response_from_for

Structs§

ErrorEventHandler
ErrorListener
EventHandler
EventHandler type is a function type that defines the signature for handling events triggered by HTTP requests. It takes references to an HTTPRequest and a mutable HTTPResponse as parameters.
HTTPRequest
The HTTPRequest struct represents an HTTP request received by the web server. It encapsulates various components of an HTTP request, including the HTTP method, request path, headers, and body.
HTTPResponse
The HTTPResponse struct represents an HTTP response that the web server can send to clients. It encapsulates various components of an HTTP response, including the response body, headers, status code, status text, and the HTTP version.
HTTPServer
This struct provide a simple http server that handle many of the use cases
Listener
Path
RequestHandler
RequestHandler type is a function type that defines the signature for handling HTTP requests. It takes HTTPRequest and HashMap<String, PathExpr> as a parameter and returns an HTTPResponse
ShutdownWrapper
SimpleEventHandler
SoftEventHandler
The SoftEventHandler type is a function type that defines the signature for handling soft events, typically without specific request or response parameters.
SoftListener
TcpServer

Enums§

HTTPMethod
The HTTPMethod enum represents the HTTP methods that can be used in HTTP requests. Each variant corresponds to a standard HTTP method.
PathExpr
A path expression represent a dynamic variable of a path
RunError

Constants§

CRLF
CRLF represents the Carriage Return (CR) and Line Feed (LF) characters combined (“\r\n”). It is commonly used as the end-of-line sequence in HTTP requests and responses.
MAX_BUFFER
MAX_BUFFER defines the maximum size, in bytes, for a request in your web server. Requests exceeding this size may be rejected or handled differently based on your server’s implementation.

Traits§

Server

Type Aliases§

Headers
The Headers type alias represents a collection of HTTP headers in key-value pairs. It is implemented as a HashMap<String, String>, where keys are header names, and values are header values.
PathMap
An hash map of PathExpr
Request
Vec<u8>
Response
Vec<u8>
URLSearchParams
The URLSearchParams type alias represents a collection of URL parameters parsed from an HTTP request’s query string. It is implemented as a HashMap<String, String> where keys are parameter names, and values are parameter values.