Module hl

Module hl 

Source
Expand description

The PDK High Level Framework.

The PDK High Level Framework is the foundation for writting single-threaded non-blocking filters as main building block for custom policies.

pdk::hl relies on a reduced portion of the Rust async ecosystem, due to the limitations of the underlying WebAssembly platform and their single-threaded nature. Despite being single-threaded, pdk::hl supports concurrent execution of multiple incoming HTTP flows (Request/Response pairs).

Re-exports§

pub use super::bootstrap::LaunchError;
pub use super::bootstrap::Launcher;
pub use super::Configuration;
pub use super::grpc;
pub use super::timer;
pub use crate::client::HttpClient;
pub use crate::client::HttpClientError;
pub use crate::client::HttpClientResponse;
pub use crate::client::InvalidUri;
pub use crate::client::Service;
pub use crate::client::Uri;
pub use crate::stream::PropertyAccessor;
pub use crate::stream::StreamProperties;

Modules§

context

Structs§

BodyStream
BodyStreamAsyncReader
Chunk
RequestBodyState
Body state of the Request state-machine.
RequestBodyStreamState
RequestHeadersState
Headers state of the Request state-machine.
RequestState
Initial state of the Request state-machine. This type is intended to be injected as a parameter in Request filters.
Response
An HTTP Response to be returned by Request filters.
ResponseBodyState
Body state of the Response state-machine.
ResponseBodyStreamState
ResponseHeadersState
Headers state of the Response state-machine.
ResponseState
Initial state of the Response state-machine. This type is intended to be injected as a parameter in Response filters.

Enums§

BodyError
The error for BodyHandler operations.
Flow
Indicates whether the current Request will continue to upstream filters or if an early Response must break the current flow. This type is intended to be returned by Request filters.
RequestData
Carries user data from Request filter to Response filter when possible and represents the three posible final statuses from a Request filter. This type is intended to be injected as a parameter in Response filters.

Traits§

BodyHandler
A handler for accessing the body of the current HTTP Flow.
BodyState
Abstract Body state of the HTTP Flow state-machine.
BodyStreamState
EntityState
Abstract initial state of the HTTP Flow state-machine.
HeadersBodyHandler
A handler for accessing the headers and body of the current HTTP Flow.
HeadersBodyState
Abstract HeadersBody state of the HTTP Flow state-machine.
HeadersHandler
A handler for accessing the headers of the current HTTP Flow.
HeadersState
Abstract Headers state of the HTTP Flow state-machine.
IntoBodyState
Abstract state of the HTTP Flow state-machine allowed to be moved into the Body state.
IntoBodyStreamState
IntoFlow
A value-to-value conversion that consumes the input value and converts it in a Flow.

Functions§

on_request
Creates a Request filter from a handler.
on_response
Creates a Response filter from a handler.