---
title: NextRequestOptions
summary: Settings to use when waiting for a second (third, fourth, ...) request.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/serve/struct.NextRequestOptions/
---

**Kind:** Struct  
**Module:** [serve](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/serve/)  
**Package:** fastly 0.13.1  
**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/serve.rs#433

```rust
pub struct NextRequestOptions { /* private fields */ }
```

Settings to use when waiting for a second (third, fourth, ...) request.

## Methods

### from_timeout

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/serve.rs#456

```rust
fn from_timeout(timeout: Duration) -> Self
```

Shorthand for `default().with_timeout(timeout)`;
see [NextRequestOptions::with_timeout](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/serve/struct.NextRequestOptions/#method-with_timeout).

**Parameters**

- `timeout`: `Duration`

**Returns**

`Self`

### with_timeout

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/serve.rs#449

```rust
fn with_timeout(self, timeout: Duration) -> Self
```

Set a bound on how long a RequestPromise can be outstanding.

This timer starts at the creation of the RequestPromise.
After the timeout, if not request is ready, the RequestPromise will report
[NextRequestError::EndOfSession](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/serve/enum.NextRequestError/).

If you want to bound how long a given .wait call lasts, use .wait_timeout.

**Parameters**

- `self`: `Self`
- `timeout`: `Duration`

**Returns**

`Self`

## Trait implementations

### impl Default for NextRequestOptions

#### default

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/http/serve.rs#432

```rust
fn default() -> Self
```

**Returns**

`Self`

## Auto trait implementations

- `Freeze`
- `RefUnwindSafe`
- `Send`
- `Sync`
- `Unpin`
- `UnsafeUnpin`
- `UnwindSafe`

## Blanket implementations

- `Any`
- `Borrow<T>`
- `BorrowMut<T>`
- `Downcast`
- `DowncastSync`
- `ErasedDestructor`
- `From<T>`
- `Into<U>`
- `IntoEither`
- `Same`
- `TryFrom<U>`
- `TryInto<U>`
