ListBuilder

Structin kv_storefastly 0.13.1View source
pub struct ListBuilder<'a> { /* private fields */ }

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

store.build_list().execute()?;

Synchronous and Asynchronous support

ListBuilder also exposes the ability to issue an asynchronous list. When finalizing the ListBuilder, 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.

Examples

// 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

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

Change the cursor of the request.

Parameters

self: Self
cursor: &str

Returns

Self

eventual_consistency

View source
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
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

View source
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>
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

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

Blanket implementations