---
title: ListBuilder
summary: A builder for KVStore key list operations, supporting advanced configuration like cursor, limit, prefix, and asynchronous execution.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/struct.ListBuilder/
---

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

```rust
pub struct ListBuilder<'a> { /* private fields */ }
```

A builder for KVStore key list operations, supporting advanced configuration like cursor, limit, prefix, and asynchronous execution.

```rust
store.build_list().execute()?;
```

## Synchronous and Asynchronous support

ListBuilder also exposes the ability to issue an asynchronous list. When finalizing the ListBuilder,
[`execute_async`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/kv_store/struct.ListBuilder/#method-execute_async) will send the request, and unblock. There is currently no polling mechanism.
To retrieve the result, use the blocking function [`pending_list_wait`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/kv_store/struct.KVStore/#method-pending_list_wait).

## Examples

```rust
// synchronous non-builder list
let result: Result<ListPage, KVStoreError> = store.list();
// synchronous builder list
let result: Result<ListPage, KVStoreError> = store.build_list().execute();
// asynchronous builder list
let list_handle: Result<PendingListHandle, KVStoreError> = store.build_list().execute_async();
let result: Result<ListPage, KVStoreError> = store.pending_list_wait(list_handle?);
```

## Methods

### cursor

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/kv_store.rs#503

```rust
fn cursor(self, cursor: &str) -> Self
```

Change the cursor of the request.

**Parameters**

- `self`: `Self`
- `cursor`: `&str`

**Returns**

`Self`

### eventual_consistency

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/kv_store.rs#496

```rust
fn eventual_consistency(self) -> Self
```

Rather than read data from the primary data source, which is slower but strongly consistent (`strong`, the default), instead read a local copy if available, which offers higher speed and may be a few seconds out of date (`eventual`).

**Parameters**

- `self`: `Self`

**Returns**

`Self`

### execute

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/kv_store.rs#529

```rust
fn execute(self) -> Result<ListPage, KVStoreError>
```

Initiate and wait on the first page of a list of values in the KV Store.

Returns `Ok(ListPage)` if the list is returned, and `KVStoreError` if the list failed.

**Parameters**

- `self`: `Self`

**Returns**

`Result<ListPage, KVStoreError>`

### execute_async

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/kv_store.rs#555

```rust
fn execute_async(&self) -> Result<PendingListHandle, KVStoreError>
```

Initiate async list of values in the KV Store.

Returns `Ok(Some(PendingListHandle))` if list creation is successful.

**Parameters**

- `self`: `&Self`

**Returns**

`Result<PendingListHandle, KVStoreError>`

### iter

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/kv_store.rs#542

```rust
fn iter(self) -> ListResponse<'a>
```

Produce a new ListResponse, which can be used as an iterator for
chunked list operations.

Returns a new `ListResponse`, primed for iteration.

**Parameters**

- `self`: `Self`

**Returns**

`ListResponse`

### limit

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/kv_store.rs#511

```rust
fn limit(self, limit: u32) -> Self
```

Set the maximum number of items included the response. The default limit is 100 items.

**Parameters**

- `self`: `Self`
- `limit`: `u32`

**Returns**

`Self`

### prefix

**Source:** https://docs.rs/crate/fastly/0.13.1/source/src/kv_store.rs#519

```rust
fn prefix(self, prefix: &str) -> Self
```

Set the prefix match for items to include in the resultset.

**Parameters**

- `self`: `Self`
- `prefix`: `&str`

**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>`
