Skip to main content

Module handler

Module handler 

Source
Available on crate feature component-model-async only.
Expand description

Provides utilities useful for dispatching incoming HTTP requests wasi:http/handler guest instances.

Structs§

ExpirationError
Returned when the guest failed to produce a response before the expiration returned by HandlerState::on_request_start elapsed.
Instance
Represents the combination of a store and instance with which to handle requests.
InstantiationError
This error is returned if, when handling the request, a new worker and associated instance needed to be created, but instantiation failed, e.g. due to reaching a pooling allocator limit or running out of memory. In this case, the caller may be able to recover and retry (e.g. after waiting for existing instances to be dropped and/or freeing memory used by caches, etc.). Otherwise, it will probably need to return an HTTP 500 error.
ProxyHandler
Represents the state of a web server.
TrapOrPanicError
A worker trapped or panicked and failed to produce a result.

Enums§

ErrorCode
Represents either a wasi:http/types@0.2.x or wasi:http/types@0.3.x error-code.
Prepared
Representation of a “prepared” call for a guest, used to extract the GuestTaskId before actually executing any handlers.
Proxy
Represents either a wasi:http/incoming-handler@0.2.x or wasi:http/handler@0.3.x instance.
ProxyPre
Represents either a wasi:http/incoming-handler@0.2.x or wasi:http/handler@0.3.x pre-instance.
ShouldAccept
Indicates whether a worker should accept new requests.
ViewFn
Represents either a p2 or p3 WasiHttpCtxView getter.
WorkerStatus
Represents the status of a ProxyHandler worker task.

Traits§

HandlerState
Represents the application-specific state of a web server.
WorkerExpiration
Represents the application-specific state of a ProxyHandler worker.
WorkerState
Represents the application-specific state of a ProxyHandler worker.

Type Aliases§

Request
A Request to be handled using ProxyHandler::handle.
Response
A Response returned by ProxyHandler::handle.