Module web

Source
Expand description

Essentials helper functions and types for application registration.

§Request Extractors

  • Data: Application data item
  • ThinData: Cheap-to-clone application data item
  • ReqData: Request-local data item
  • Path: URL path parameters / dynamic segments
  • Query: URL query parameters
  • Header: Typed header
  • Json: JSON payload
  • Form: URL-encoded payload
  • Bytes: Raw payload

§Responders

  • Json: JSON response
  • Form: URL-encoded response
  • Bytes: Raw bytes response
  • Redirect: Convenient redirect responses

Structs§

Bytes
A cheaply cloneable and sliceable chunk of contiguous memory.
BytesMut
A unique reference to a contiguous slice of memory.
Data
Application data wrapper and extractor.
Form
URL encoded payload extractor and responder.
FormConfig
Form extractor configuration.
Header
Extract typed headers from the request.
Html
Semantic HTML responder.
Json
JSON extractor and responder.
JsonConfig
Json extractor configuration.
Path
Extract typed data from request path segments.
PathConfig
Path extractor configuration
Payload
Extract a request’s raw payload stream.
PayloadConfig
Configuration for request payloads.
Query
Extract typed information from the request’s query.
QueryConfig
Query extractor configuration.
Readlines
Stream that reads request line by line.
Redirect
An HTTP service for redirecting one path to another path or URL.
ReqData
Request-local data extractor.
ServiceConfig
Enables parts of app configuration to be declared separately from the app itself. Helpful for modularizing large applications.
ThinData
Application data wrapper and extractor for cheaply-cloned types.
UrlEncoded
Future that resolves to some T when parsed from a URL encoded payload.

Enums§

Either
Combines two extractor or responder types into a single type.
JsonBody
Future that resolves to some T when parsed from a JSON payload.

Traits§

Buf
Read bytes from a buffer.
BufMut
A trait for values that provide sequential write access to bytes.

Functions§

block
Executes blocking function on a thread pool, returns future that resolves to result of the function execution.
delete
Creates a new route with DELETE method guard.
get
Creates a new route with GET method guard.
head
Creates a new route with HEAD method guard.
method
Creates a new route with specified method guard.
patch
Creates a new route with PATCH method guard.
post
Creates a new route with POST method guard.
put
Creates a new route with PUT method guard.
redirect
Create a relative or absolute redirect.
resource
Creates a new resource for a specific path.
route
Creates a new un-configured route.
scope
Creates scope for common path prefix.
service
Creates a raw service for a specific path.
to
Creates a new any-method route with handler.
trace
Creates a new route with TRACE method guard.