pub struct ListKeyVersionsResponse {
pub key_versions: Vec<KeyValue>,
pub next_page_token: Option<String>,
pub global_version: Option<i64>,
}
Expand description
Server response for ListKeyVersions
API.
Fields§
§key_versions: Vec<KeyValue>
Fetched keys and versions.
Even though this API reuses the KeyValue
struct, the value
sub-field will not be set by the server.
next_page_token: Option<String>
next_page_token
is a pagination token, used to retrieve the next page of results.
Use this value to query for next-page of paginated ListKeyVersions
operation, by specifying
this value as the page_token
in the next request.
If next_page_token
is empty (“”), then the “last page” of results has been processed and
there is no more data to be retrieved.
If next_page_token
is not empty, it does not necessarily mean that there is more data in the
result set. The only way to know when you have reached the end of the result set is when
next_page_token
is empty.
Caution: Clients must not assume a specific number of key_versions to be present in a page for paginated response.
global_version: Option<i64>
global_version
is a sequence-number/version of the whole store.
global_version
is only returned in response for the first page of the ListKeyVersionsResponse
and is guaranteed to be read before reading any key-versions.
In case of refreshing the complete key-version view on the client-side, correct usage for
the returned global_version
is as following:
- Read
global_version
from the first page of paginated response and save it as local variable. - Update all the
key_versions
on client-side from all the pages of paginated response. - Update
global_version
on client_side from the local variable saved in step-1. This ensures that on client-side, all currentkey_versions
were stored atglobal_version
or later. This guarantee is helpful for ensuring the versioning correctness if using theglobal_version
inPutObject
API and can help avoid the race conditions related to it.
Implementations§
Source§impl ListKeyVersionsResponse
impl ListKeyVersionsResponse
Sourcepub fn next_page_token(&self) -> &str
pub fn next_page_token(&self) -> &str
Returns the value of next_page_token
, or the default value if next_page_token
is unset.
Sourcepub fn global_version(&self) -> i64
pub fn global_version(&self) -> i64
Returns the value of global_version
, or the default value if global_version
is unset.
Trait Implementations§
Source§impl Clone for ListKeyVersionsResponse
impl Clone for ListKeyVersionsResponse
Source§fn clone(&self) -> ListKeyVersionsResponse
fn clone(&self) -> ListKeyVersionsResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ListKeyVersionsResponse
impl Debug for ListKeyVersionsResponse
Source§impl Default for ListKeyVersionsResponse
impl Default for ListKeyVersionsResponse
Source§impl Message for ListKeyVersionsResponse
impl Message for ListKeyVersionsResponse
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.