pub struct KvStoreApiClient { /* private fields */ }Expand description
Client for the QuickNode Key-Value Store. Supports two primitives: sets (single string values under a key) and lists (ordered collections of strings under a key).
Implementations§
Source§impl KvStoreApiClient
impl KvStoreApiClient
pub fn new(config: SdkConfig) -> Self
Sourcepub async fn create_set(&self, params: &CreateSetParams) -> Result<(), SdkError>
pub async fn create_set(&self, params: &CreateSetParams) -> Result<(), SdkError>
Creates a new set, storing a single string value under the given key.
Sourcepub async fn get_sets(
&self,
params: &GetSetsParams,
) -> Result<GetSetsResponse, SdkError>
pub async fn get_sets( &self, params: &GetSetsParams, ) -> Result<GetSetsResponse, SdkError>
Returns a paginated page of key/value entries from the store. Use the
response cursor to fetch subsequent pages.
Sourcepub async fn get_set(&self, key: &str) -> Result<GetSetResponse, SdkError>
pub async fn get_set(&self, key: &str) -> Result<GetSetResponse, SdkError>
Returns the string value stored for a single set by key.
Sourcepub async fn bulk_sets(&self, params: &BulkSetsParams) -> Result<(), SdkError>
pub async fn bulk_sets(&self, params: &BulkSetsParams) -> Result<(), SdkError>
Adds and removes multiple sets in a single request. Either add_sets,
delete_sets, or both may be supplied.
Sourcepub async fn create_list(
&self,
params: &CreateListParams,
) -> Result<(), SdkError>
pub async fn create_list( &self, params: &CreateListParams, ) -> Result<(), SdkError>
Creates a new list under the given key, seeded with the provided items.
Sourcepub async fn get_lists(
&self,
params: &GetListsParams,
) -> Result<GetListsResponse, SdkError>
pub async fn get_lists( &self, params: &GetListsParams, ) -> Result<GetListsResponse, SdkError>
Returns a paginated page of list keys from the store. Use the response
cursor to fetch subsequent pages.
Sourcepub async fn get_list(
&self,
key: &str,
params: &GetListParams,
) -> Result<GetListResponse, SdkError>
pub async fn get_list( &self, key: &str, params: &GetListParams, ) -> Result<GetListResponse, SdkError>
Returns a paginated page of items from the list identified by key.
Use the response cursor to fetch subsequent pages.
Sourcepub async fn update_list(
&self,
key: &str,
params: &UpdateListParams,
) -> Result<(), SdkError>
pub async fn update_list( &self, key: &str, params: &UpdateListParams, ) -> Result<(), SdkError>
Updates an existing list by adding and/or removing items in a single
operation. Either add_items, remove_items, or both may be supplied.
Sourcepub async fn add_list_item(
&self,
key: &str,
params: &AddListItemParams,
) -> Result<(), SdkError>
pub async fn add_list_item( &self, key: &str, params: &AddListItemParams, ) -> Result<(), SdkError>
Appends a single item to the list identified by key.
Sourcepub async fn list_contains_item(
&self,
key: &str,
item: &str,
) -> Result<ListContainsItemResponse, SdkError>
pub async fn list_contains_item( &self, key: &str, item: &str, ) -> Result<ListContainsItemResponse, SdkError>
Checks whether the specified list contains the given item.
Trait Implementations§
Source§impl Clone for KvStoreApiClient
impl Clone for KvStoreApiClient
Source§fn clone(&self) -> KvStoreApiClient
fn clone(&self) -> KvStoreApiClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more