Module prelude

Module prelude 

Source
Expand description

A useful set of types for getting started

Modules§

fast_timeout
The fast and more complicated version of pingora-timeout
timer
Lightweight timer for systems with high rate of operations with timeout associated with them

Structs§

Elapsed
The error type returned when the timeout is reached.
Error
The struct that represents an error
HttpPeer
A peer representing the remote HTTP server to connect to
Opt
Command-line options
RequestHeader
The HTTP request header type.
Server
The server object
Session
The established HTTP session
Timeout
The timeout future returned by the timeout functions
TokioTimeout
The timeout generated by tokio_timeout().

Enums§

ErrorSource
The source of the error
ErrorType
Predefined type of errors
ImmutStr
A data struct that holds either immutable string or reference to static str. Compared to String or Box<str>, it avoids memory allocation on static str.
RetryType
Whether the request can be retried after encountering this error

Traits§

Context
Helper trait to add more context to a given error
ErrorTrait
Error is a trait representing the basic expectations for error values, i.e., values of type E in Result<T, E>.
OkOrErr
Helper trait to convert an Option to an Error with context.
OrErr
Helper trait to chain errors with context
ProxyHttp
The interface to control the HTTP proxy
ToTimeout
The interface to start a timeout

Functions§

background_service
http_proxy_service
Create a Service from the user implemented ProxyHttp.
sleep
Similar to tokio::time::sleep but more efficient.
timeout
Similar to tokio::time::timeout but more efficient.
tokio_timeout
The tokio::time::timeout with just lazy timer initialization.

Type Aliases§

BError
The boxed Error, the desired way to pass Error
Result
Syntax sugar for std::Result<T, BError>