pub trait KVClient {
// Required methods
fn range_with_request<'life0, 'async_trait>(
&'life0 mut self,
request: RangeRequest,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_options(&self) -> &KVOptions;
// Provided methods
fn range<'life0, 'async_trait>(
&'life0 mut self,
key: ByteSequence,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: Send + 'async_trait { ... }
fn range_with_prefix<'life0, 'async_trait>(
&'life0 mut self,
prefix: ByteSequence,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: Send + 'async_trait { ... }
fn range_with_str<'life0, 'life1, 'async_trait>(
&'life0 mut self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: Send + 'async_trait { ... }
fn range_with_end<'life0, 'async_trait>(
&'life0 mut self,
key: ByteSequence,
range_end: ByteSequence,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: Send + 'async_trait { ... }
fn range_all<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: Send + 'async_trait { ... }
fn range_with_options<'life0, 'async_trait>(
&'life0 mut self,
key: Option<ByteSequence>,
range_end: Option<ByteSequence>,
revision: Option<i64>,
sort_order: Option<i32>,
sort_target: Option<i32>,
serializable: Option<bool>,
keys_only: Option<bool>,
count_only: Option<bool>,
min_mod_revision: Option<i64>,
max_mod_revision: Option<i64>,
min_create_revision: Option<i64>,
max_create_revision: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: Send + 'async_trait { ... }
fn build_range_request(
&self,
key: Option<ByteSequence>,
range_end: Option<ByteSequence>,
limit: Option<i64>,
revision: Option<i64>,
sort_order: Option<i32>,
sort_target: Option<i32>,
serializable: Option<bool>,
keys_only: Option<bool>,
count_only: Option<bool>,
min_mod_revision: Option<i64>,
max_mod_revision: Option<i64>,
min_create_revision: Option<i64>,
max_create_revision: Option<i64>,
) -> RangeRequest { ... }
}Expand description
KVClient defines the interface for interacting with the key-value store. It provides methods to perform range queries with various options.
Required Methods§
Sourcefn range_with_request<'life0, 'async_trait>(
&'life0 mut self,
request: RangeRequest,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn range_with_request<'life0, 'async_trait>(
&'life0 mut self,
request: RangeRequest,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Performs a range query using a pre-constructed RangeRequest.
§Arguments
request- The RangeRequest to use for the query.
§Returns
Result<Response<RangeResponse>, Error>- The response containing the range results or an error if the operation fails.
§Errors
- Returns an
Errorif the range operation fails.
Sourcefn get_options(&self) -> &KVOptions
fn get_options(&self) -> &KVOptions
Retrieves the KV options associated with this client.
§Returns
&KVOptions- A reference to the KVOptions.
Provided Methods§
Sourcefn range<'life0, 'async_trait>(
&'life0 mut self,
key: ByteSequence,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
fn range<'life0, 'async_trait>(
&'life0 mut self,
key: ByteSequence,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
Sourcefn range_with_prefix<'life0, 'async_trait>(
&'life0 mut self,
prefix: ByteSequence,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
fn range_with_prefix<'life0, 'async_trait>(
&'life0 mut self,
prefix: ByteSequence,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
Sourcefn range_with_str<'life0, 'life1, 'async_trait>(
&'life0 mut self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Send + 'async_trait,
fn range_with_str<'life0, 'life1, 'async_trait>(
&'life0 mut self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: Send + 'async_trait,
Sourcefn range_with_end<'life0, 'async_trait>(
&'life0 mut self,
key: ByteSequence,
range_end: ByteSequence,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
fn range_with_end<'life0, 'async_trait>(
&'life0 mut self,
key: ByteSequence,
range_end: ByteSequence,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
Performs a range query for the specified key and range end.
§Arguments
key- The key to query as a string.range_end- The end of the range to query.
§Returns
Result<Response<RangeResponse>, Error>- The response containing the range results or an error if the operation fails.
§Errors
- Returns an
Errorif the range operation fails.
Sourcefn range_all<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
fn range_all<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
Sourcefn range_with_options<'life0, 'async_trait>(
&'life0 mut self,
key: Option<ByteSequence>,
range_end: Option<ByteSequence>,
revision: Option<i64>,
sort_order: Option<i32>,
sort_target: Option<i32>,
serializable: Option<bool>,
keys_only: Option<bool>,
count_only: Option<bool>,
min_mod_revision: Option<i64>,
max_mod_revision: Option<i64>,
min_create_revision: Option<i64>,
max_create_revision: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
fn range_with_options<'life0, 'async_trait>(
&'life0 mut self,
key: Option<ByteSequence>,
range_end: Option<ByteSequence>,
revision: Option<i64>,
sort_order: Option<i32>,
sort_target: Option<i32>,
serializable: Option<bool>,
keys_only: Option<bool>,
count_only: Option<bool>,
min_mod_revision: Option<i64>,
max_mod_revision: Option<i64>,
min_create_revision: Option<i64>,
max_create_revision: Option<i64>,
) -> Pin<Box<dyn Future<Output = Result<Response<RangeResponse>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Send + 'async_trait,
Performs a range query with various options.
§Arguments
key- The key to query (optional).range_end- The end of the range to query (optional).revision- The revision to query at (optional).sort_order- The order to sort the results (optional).sort_target- The target to sort the results by (optional).serializable- Whether to perform a serializable read (optional).keys_only- Whether to return only keys (optional).count_only- Whether to return only the count of keys (optional).min_mod_revision- Minimum modification revision to filter results (optional).max_mod_revision- Maximum modification revision to filter results (optional).min_create_revision- Minimum creation revision to filter results (optional).max_create_revision- Maximum creation revision to filter results (optional).
§Returns
Result<Response<RangeResponse>, Error>- The response containing the range results or an error if the operation fails.
§Errors
- Returns an
Errorif the range operation fails.
Sourcefn build_range_request(
&self,
key: Option<ByteSequence>,
range_end: Option<ByteSequence>,
limit: Option<i64>,
revision: Option<i64>,
sort_order: Option<i32>,
sort_target: Option<i32>,
serializable: Option<bool>,
keys_only: Option<bool>,
count_only: Option<bool>,
min_mod_revision: Option<i64>,
max_mod_revision: Option<i64>,
min_create_revision: Option<i64>,
max_create_revision: Option<i64>,
) -> RangeRequest
fn build_range_request( &self, key: Option<ByteSequence>, range_end: Option<ByteSequence>, limit: Option<i64>, revision: Option<i64>, sort_order: Option<i32>, sort_target: Option<i32>, serializable: Option<bool>, keys_only: Option<bool>, count_only: Option<bool>, min_mod_revision: Option<i64>, max_mod_revision: Option<i64>, min_create_revision: Option<i64>, max_create_revision: Option<i64>, ) -> RangeRequest
Builds a RangeRequest with the specified parameters.
§Arguments
key- The key to query (optional).range_end- The end of the range to query (optional).limit- The maximum number of results to return (optional).revision- The revision to query at (optional).sort_order- The order to sort the results (optional).sort_target- The target to sort the results by (optional).serializable- Whether to perform a serializable read (optional).keys_only- Whether to return only keys (optional).count_only- Whether to return only the count of keys (optional).min_mod_revision- Minimum modification revision to filter results (optional).max_mod_revision- Maximum modification revision to filter results (optional).min_create_revision- Minimum creation revision to filter results (optional).max_create_revision- Maximum creation revision to filter results (optional).
§Returns
RangeRequest- The constructed RangeRequest.