Struct vss_client::client::VssClient
source · pub struct VssClient { /* private fields */ }Expand description
Thin-client to access a hosted instance of Versioned Storage Service (VSS).
The provided VssClient API is minimalistic and is congruent to the VSS server-side API.
Implementations§
source§impl VssClient
impl VssClient
sourcepub fn new(base_url: &str) -> Self
pub fn new(base_url: &str) -> Self
Constructs a VssClient using base_url as the VSS server endpoint.
sourcepub async fn get_object(
&self,
request: &GetObjectRequest
) -> Result<GetObjectResponse, VssError>
pub async fn get_object( &self, request: &GetObjectRequest ) -> Result<GetObjectResponse, VssError>
Fetches a value against a given key in request.
Makes a service call to the GetObject endpoint of the VSS server.
For API contract/usage, refer to docs for GetObjectRequest and GetObjectResponse.
sourcepub async fn put_object(
&self,
request: &PutObjectRequest
) -> Result<PutObjectResponse, VssError>
pub async fn put_object( &self, request: &PutObjectRequest ) -> Result<PutObjectResponse, VssError>
Writes multiple PutObjectRequest::transaction_items as part of a single transaction.
Makes a service call to the PutObject endpoint of the VSS server, with multiple items.
Items in the request are written in a single all-or-nothing transaction.
For API contract/usage, refer to docs for PutObjectRequest and PutObjectResponse.
sourcepub async fn delete_object(
&self,
request: &DeleteObjectRequest
) -> Result<DeleteObjectResponse, VssError>
pub async fn delete_object( &self, request: &DeleteObjectRequest ) -> Result<DeleteObjectResponse, VssError>
Deletes the given key and value in request.
Makes a service call to the DeleteObject endpoint of the VSS server.
For API contract/usage, refer to docs for DeleteObjectRequest and DeleteObjectResponse.
sourcepub async fn list_key_versions(
&self,
request: &ListKeyVersionsRequest
) -> Result<ListKeyVersionsResponse, VssError>
pub async fn list_key_versions( &self, request: &ListKeyVersionsRequest ) -> Result<ListKeyVersionsResponse, VssError>
Lists keys and their corresponding version for a given ListKeyVersionsRequest::store_id.
Makes a service call to the ListKeyVersions endpoint of the VSS server.
For API contract/usage, refer to docs for ListKeyVersionsRequest and ListKeyVersionsResponse.