Expand description
A simple webserver.
The simple-server crate is designed to give you the tools to to build
an HTTP server, based around the http crate, blocking I/O, and a
threadpool.
We call it ‘simple’ want to keep the code small, and easy to understand. This is why we’re only using blocking I/O. Depending on your needs, you may or may not want to choose another server. However, just the simple stuff is often enough for many projects.
§Examples
At its core, simple-server contains a Server. The Server is
passed a handler upon creation, and the listen method is used
to start handling connections.
The other types are from the http crate, and give you the ability
to work with various aspects of HTTP. The Request, Response, and
ResponseBuilder types are used by the handler you give to Server,
for example.
To see examples of this crate in use, please consult the examples
directory.
Structs§
- Builder
- An HTTP response builder
- Invalid
Status Code - A possible error value when converting a
StatusCodefrom au16or&str - Method
- The Request Method (VERB)
- Parts
- Component parts of an HTTP
Response - Request
- Represents an HTTP request.
- Response
- Represents an HTTP response
- Response
Builder - An HTTP response builder
- Server
- A web server.
- Status
Code - An HTTP status code (
status-codein RFC 7230 et al.).
Enums§
- Error
- Various errors that may happen while handling requests.