Skip to main content

Module http

Module http 

Source
Expand description

HTTP requests, downloads and the client that sends them.

Structs§

BytesBody
A body already in memory, handed out in CHUNK_LEN-sized pieces.
HttpControl
Cancellation and progress shared with an in-flight request.
HttpProgress
How much of a transfer has arrived.
HttpRequest
One request.
HttpResponse
What a server answered, with its body still to be read.
StubHttpClient
An HTTP client that answers from a function rather than a network.

Enums§

HttpError
Why an HTTP transfer failed.
HttpMethod
The verbs a request can use.

Traits§

CancelTransfer
A transfer that stops at once when its HttpControl is cancelled, registered with HttpControl::on_cancel by the backend running it.
HttpBody
A response body, read a chunk at a time.
HttpClient
A platform’s HTTP.
PlatformDownloader
A platform’s own transfer for HttpClient::download_to, one that goes on while the application is suspended or closed.

Functions§

default_http_client
The platform’s HTTP client.
downloaded_length
How much of a download into target is on the device: the file’s length, or more where the platform keeps a paused transfer’s bytes apart from the file, as iOS does. An application shows a paused download’s progress with it.
http_body_ref
Wraps body in an HttpBodyRef.
local_http_client
The HTTP client a composable reads. It is the platform client unless a composition local provider above it supplies another one.
map_ordered_concurrent
Runs task for every item with at most concurrency tasks at a time, each on its own thread. Results keep the order of items. A concurrency of zero counts as one. Returns HttpError::WorkerPanicked when a task panics.
set_platform_downloader
Installs the platform’s downloader; default_http_client then runs download_to through it. iOS installs one on a background URLSession.

Type Aliases§

HttpBodyRef
Shared handle to a response body.
HttpClientRef
Shared handle to an HttpClient.
HttpFuture
The future that an HTTP operation returns. It is Send, so it can run on any thread.
ProgressHandler
What a progress report is handed to.
StubAnswer
What a StubHttpClient answers a request with.