pub struct VssClient<R>where
R: RetryPolicy<E = VssError>,{ /* 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<R: RetryPolicy<E = VssError>> VssClient<R>
impl<R: RetryPolicy<E = VssError>> VssClient<R>
Sourcepub fn new(base_url: String, retry_policy: R) -> Self
pub fn new(base_url: String, retry_policy: R) -> Self
Constructs a VssClient using base_url as the VSS server endpoint.
Sourcepub fn from_client(base_url: String, client: Client, retry_policy: R) -> Self
pub fn from_client(base_url: String, client: Client, retry_policy: R) -> Self
Constructs a VssClient from a given reqwest::Client, using base_url as the VSS server endpoint.
Sourcepub fn new_with_headers(
base_url: String,
retry_policy: R,
header_provider: Arc<dyn VssHeaderProvider>,
) -> Self
pub fn new_with_headers( base_url: String, retry_policy: R, header_provider: Arc<dyn VssHeaderProvider>, ) -> Self
Constructs a VssClient using base_url as the VSS server endpoint.
HTTP headers will be provided by the given header_provider.
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.