---
title: handle
summary: Low-level interfaces to the Compute APIs.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/
---

**Kind:** Module  
**Package:** fastly 0.13.1  
**Path:** `fastly::handle`

Low-level interfaces to the Compute APIs.

For most applications, you should instead use the types in the top level of the crate, such as
[`Request`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/request/struct.Request/) and [`Response`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/struct.Response/). Future SDKs will not include
these interfaces.

## Reasons not to use handles

- The high-level interface has many more conveniences for application development. For example,
  there are methods for transparently reading and writing HTTP bodies as JSON, and common
  function argument types such as header values can accept and convert a variety of types
  automatically.

- [`BodyHandle`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.BodyHandle/) and [`StreamingBodyHandle`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.StreamingBodyHandle/) are unbuffered. Performance can suffer dramatically
  if repeated small reads and writes are made to these types. The higher-level equivalents,
  [`Body`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/body/struct.Body/) and [`StreamingBody`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/body/struct.StreamingBody/) are buffered
  automatically, though you can explicitly control some aspects of the buffering using
  [`std::io::BufRead`](https://doc.rust-lang.org/stable/alloc/io/buf_read/trait.BufRead.html) and [`std::io::Write::flush()`](https://doc.rust-lang.org/stable/core/io/write/Write/fn.flush.html).

- Explicit buffer sizes are required to get data such as header values from the Compute
  host. If the size you choose isn't large enough, the operation will fail with an error and
  make you try again. The high-level interfaces automatically retry any such operations with the
  necessary buffer sizes.

- The high-level interface keeps data about a request or response in WebAssembly memory until it
  is sent to the client or a backend, whereas the handle interface is backed by memory in the
  Compute host.

  Suppose your application needs to manipulate headers in multiple functions. The handle
  interface would require you to either manually keep track of the headers separately from the
  handle they came from, or perform redundant copies to and from WebAssembly memory. The
  high-level interface would keep all of your header information in WebAssembly until it's ready
  to use, improving performance.

## Modules

| Name | Summary |
| --- | --- |
| [config_store](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/config_store/) | Low-level Compute Config Store interfaces. |
| [dictionary](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/dictionary/) | Low-level Compute Dictionary interfaces. |
| [secret_store](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/secret_store/) | Low-level Compute Secret Store interfaces. |

## Structs

| Name | Summary |
| --- | --- |
| [BodyHandle](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.BodyHandle/) | A low-level interface to HTTP bodies. |
| [PendingRequestHandle](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.PendingRequestHandle/) | A handle to a pending asynchronous request returned by [`RequestHandle::send_async()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/#method-send_async) or [`RequestHandle::send_async_streaming()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/#method-send_async_streaming). |
| [RequestHandle](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.RequestHandle/) | The low-level interface to HTTP requests. |
| [ResponseHandle](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.ResponseHandle/) | A low-level interface to HTTP responses. |
| [StreamingBodyHandle](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.StreamingBodyHandle/) | A low-level interface to a streaming HTTP body. |

## Enums

| Name | Summary |
| --- | --- |
| [CacheOverride](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/enum.CacheOverride/) | Optional override for response caching behavior. These options mostly apply during host caching, but guest caching also respects them. |
| [PollHandleResult](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/enum.PollHandleResult/) | The result of a call to [`PendingRequestHandle::poll()`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.PendingRequestHandle/#method-poll). |

## Functions

| Name | Summary |
| --- | --- |
| [client_request_and_body](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/fn.client_request_and_body/) | Get handles to the client request headers and body at the same time. |
| [select_handles](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/fn.select_handles/) | Given a collection of [`PendingRequestHandle`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/handle/struct.PendingRequestHandle/)s, block until the result of one of the handles is ready. |
