DeleteBuilder

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

A builder for KVStore deletes, supporting advanced features like asynchronous execution.

store.build_delete()
.execute("key1")?;

Synchronous and Asynchronous support

DeleteBuilder exposes the ability to issue an asynchronous delete. Using execute_async will send the request, and unblock. There is currently no polling mechanism. To retrieve the result, use the blocking function pending_delete_wait.

Examples

// synchronous non-builder delete
let result: Result<(), KVStoreError> = store.delete("key");
// synchronous builder delete
let result: Result<(), KVStoreError> = store.build_delete().execute("key");
// asynchronous builder delete
let delete_handle: Result<PendingDeleteHandle, KVStoreError> = store.build_delete().execute_async("key");
let result: Result<(), KVStoreError> = store.pending_delete_wait(delete_handle?);

Methods

fn execute(&self, key: &str) -> Result<(), KVStoreError>

Initiate and wait on an delete of a value in the KV Store.

Returns Ok(())) if the value is deleted without error, and KVStoreError if the delete failed.

Parameters

self: &Self
key: &str

Returns

Result<(), KVStoreError>

execute_async

View source
fn execute_async(&self, key: &str) -> Result<PendingDeleteHandle, KVStoreError>

Initiate async delete of a value in the KV Store.

Returns Ok(PendingDeleteHandle) if delete creation is successful.

Parameters

self: &Self
key: &str

Returns

Result<PendingDeleteHandle, KVStoreError>

Auto trait implementations

Blanket implementations