KVStore
pub struct KVStore { /* private fields */ }Keys in the KV Store must follow the following rules:
- Keys can contain any sequence of valid Unicode characters, of length 1-1024 bytes when UTF-8 encoded.
- Keys cannot contain Carriage Return or Line Feed characters.
- Keys cannot start with
.well-known/acme-challenge/. - Keys cannot be named
.or...
Methods
build_delete
View sourceCreate a buildable delete request for the KV Store.
When the desired configuration has been set, execute the delete and wait for the response.
Parameters
- self: &Self
Returns
build_insert
View sourceCreate a buildable insert request for the KV Store.
When the desired configuration has been set, execute the insert and wait for the response.
Parameters
- self: &Self
Returns
build_list
View sourceCreate a buildable list request for the KV Store.
When the desired configuration has been set, execute the list and wait for the response.
Parameters
- self: &Self
Returns
build_lookup
View sourceCreate a buildable lookup request for the KV Store.
When the desired configuration has been set, execute the lookup and wait for the response.
Parameters
- self: &Self
Returns
delete
View sourceDelete a value in the KV Store.
Returns Ok(()) if delete is successful.
Parameters
- self: &Self
- key: &str
Returns
insert
View sourceInsert a value into the KV Store.
If the store already contained a value for this key, it will be overwritten.
The value may be provided as any type that can be converted to Body, such as &[u8],
Vec<u8>, &str, or String.
Value sizes
The size of the value must be known when calling this method. In practice, that means that
if a Body value contains an external request or response, it must be encoded with
Content-Length rather than Transfer-Encoding: chunked.
Parameters
Returns
list
View sourceList keys in the KV Store.
Returns an Ok(ListPage) on success, and Err(KVStoreError) if there was a failure. The
limit of items per page defaults to 100 items, but can be configured through ListBuilder.
Parameters
- self: &Self
Returns
lookup
View sourceLook up a value in the KV Store.
Returns Ok(LookupResponse) if the value is retrieved without error, and KVStoreError if the lookup failed.
Parameters
- self: &Self
- key: &str
Returns
open
View sourceOpen the KV Store with the given name.
If there is no store by that name, this returns Ok(None).
Parameters
- name: &str
Returns
pending_delete_wait
View sourcefn pending_delete_wait(&self, pending_delete_handle: PendingDeleteHandle) -> Result<(), KVStoreError>Delete a value in the KV Store.
Returns Ok(()) if the key is deleted, and KVStoreError if the key was not found.
Parameters
- self: &Self
- pending_delete_handle: PendingDeleteHandle
Returns
pending_insert_wait
View sourcefn pending_insert_wait(&self, pending_insert_handle: PendingInsertHandle) -> Result<(), KVStoreError>Insert a value in the KV Store.
Returns Ok(()) if the value is found, and KVStoreError if the key was not found.
Parameters
- self: &Self
- pending_insert_handle: PendingInsertHandle
Returns
pending_list_wait
View sourceWait on a pending list operation.
Returns Ok(ListPage) on success, and Err(KVStoreError) if there was a failure.
Parameters
- self: &Self
- pending_request_handle: PendingListHandle
Returns
pending_lookup_wait
View sourcefn pending_lookup_wait(&self, pending_request_handle: PendingLookupHandle) -> Result<LookupResponse, KVStoreError>Look up a value in the KV Store.
Returns Ok(LookupResponse) if the value is found, and Err(KVStoreError) if the lookup failed.
Parameters
- self: &Self
- pending_request_handle: PendingLookupHandle
Returns