pub struct Client { /* private fields */ }Expand description
A configured Objects account client.
Implementations§
Source§impl Client
impl Client
Sourcepub async fn connect(
endpoint: impl AsRef<str>,
bearer_token: impl AsRef<str>,
) -> Result<Self>
pub async fn connect( endpoint: impl AsRef<str>, bearer_token: impl AsRef<str>, ) -> Result<Self>
Connect to an account endpoint using its account-bound bearer credential.
§Errors
Returns an error when the endpoint/credential is invalid or the TLS connection fails.
Sourcepub async fn connect_with_ca_certificate(
endpoint: impl AsRef<str>,
bearer_token: impl AsRef<str>,
certificate_pem: impl AsRef<[u8]>,
) -> Result<Self>
pub async fn connect_with_ca_certificate( endpoint: impl AsRef<str>, bearer_token: impl AsRef<str>, certificate_pem: impl AsRef<[u8]>, ) -> Result<Self>
Connect to an account endpoint augmented by one caller-supplied private CA bundle.
The certificate augments the client’s roots for this connection only. HTTPS remains mandatory, and the process-wide trust store is never changed.
§Errors
Returns an error when the endpoint, credential, or bounded CA bundle is invalid, or when the authenticated TLS connection fails.
Sourcepub async fn create_bucket(
&self,
name: impl Into<String>,
options: MutationOptions,
) -> Result<Bucket>
pub async fn create_bucket( &self, name: impl Into<String>, options: MutationOptions, ) -> Result<Bucket>
Create a permanently versioned bucket.
§Errors
Returns an error when the service rejects or cannot complete the request.
Sourcepub async fn open_bucket(&self, reference: BucketRef) -> Result<Bucket>
pub async fn open_bucket(&self, reference: BucketRef) -> Result<Bucket>
Validate and open one exact persisted bucket identity.
§Errors
Returns an error when the identity is stale, mismatched, or unavailable.
Sourcepub fn snapshot(&self, reference: SnapshotRef) -> Snapshot
pub fn snapshot(&self, reference: SnapshotRef) -> Snapshot
Reconstruct a read-only snapshot handle from its exact persisted identity.
Trait Implementations§
Source§impl ObjectsProvider for Client
impl ObjectsProvider for Client
Source§fn create_bucket<'life0, 'async_trait>(
&'life0 self,
name: String,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<Bucket, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_bucket<'life0, 'async_trait>(
&'life0 self,
name: String,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<Bucket, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn head_bucket<'life0, 'life1, 'async_trait>(
&'life0 self,
bucket: &'life1 BucketRef,
) -> Pin<Box<dyn Future<Output = Result<Bucket, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn head_bucket<'life0, 'life1, 'async_trait>(
&'life0 self,
bucket: &'life1 BucketRef,
) -> Pin<Box<dyn Future<Output = Result<Bucket, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn delete_bucket<'life0, 'life1, 'async_trait>(
&'life0 self,
bucket: &'life1 BucketRef,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<bool, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_bucket<'life0, 'life1, 'async_trait>(
&'life0 self,
bucket: &'life1 BucketRef,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<bool, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn put<'life0, 'async_trait>(
&'life0 self,
request: PutRequest,
) -> Pin<Box<dyn Future<Output = Result<ObjectVersion, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
request: PutRequest,
) -> Pin<Box<dyn Future<Output = Result<ObjectVersion, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get<'life0, 'async_trait>(
&'life0 self,
request: GetRequest,
) -> Pin<Box<dyn Future<Output = Result<BufferedObject, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
request: GetRequest,
) -> Pin<Box<dyn Future<Output = Result<BufferedObject, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn delete<'life0, 'async_trait>(
&'life0 self,
bucket: BucketRef,
object_key: String,
version_id: Option<String>,
condition: Option<Condition>,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<DeleteResult, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
bucket: BucketRef,
object_key: String,
version_id: Option<String>,
condition: Option<Condition>,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<DeleteResult, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn list<'life0, 'async_trait>(
&'life0 self,
target: ReadTarget,
prefix: String,
delimiter: Option<String>,
versions: bool,
page_size: u32,
continuation: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<ProviderListPage, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
target: ReadTarget,
prefix: String,
delimiter: Option<String>,
versions: bool,
page_size: u32,
continuation: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<ProviderListPage, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn snapshot<'life0, 'async_trait>(
&'life0 self,
bucket: BucketRef,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<Snapshot, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn snapshot<'life0, 'async_trait>(
&'life0 self,
bucket: BucketRef,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<Snapshot, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn destroy_snapshot<'life0, 'async_trait>(
&'life0 self,
snapshot: SnapshotRef,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<bool, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn destroy_snapshot<'life0, 'async_trait>(
&'life0 self,
snapshot: SnapshotRef,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<bool, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn fork<'life0, 'async_trait>(
&'life0 self,
source: ReadTarget,
destination_name: String,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<Bucket, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fork<'life0, 'async_trait>(
&'life0 self,
source: ReadTarget,
destination_name: String,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<Bucket, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn create_multipart<'life0, 'async_trait>(
&'life0 self,
bucket: BucketRef,
object_key: String,
metadata: ObjectMetadata,
condition: Option<Condition>,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<MultipartUpload, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_multipart<'life0, 'async_trait>(
&'life0 self,
bucket: BucketRef,
object_key: String,
metadata: ObjectMetadata,
condition: Option<Condition>,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<MultipartUpload, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn upload_part<'life0, 'async_trait>(
&'life0 self,
bucket: BucketRef,
object_key: String,
upload_id: String,
part_number: u32,
body: Bytes,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<UploadedPart, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upload_part<'life0, 'async_trait>(
&'life0 self,
bucket: BucketRef,
object_key: String,
upload_id: String,
part_number: u32,
body: Bytes,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<UploadedPart, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn list_parts<'life0, 'async_trait>(
&'life0 self,
bucket: BucketRef,
object_key: String,
upload_id: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<UploadedPart>, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_parts<'life0, 'async_trait>(
&'life0 self,
bucket: BucketRef,
object_key: String,
upload_id: String,
) -> Pin<Box<dyn Future<Output = Result<Vec<UploadedPart>, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn complete_multipart<'life0, 'async_trait>(
&'life0 self,
bucket: BucketRef,
object_key: String,
upload_id: String,
parts: Vec<UploadedPart>,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<ObjectVersion, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn complete_multipart<'life0, 'async_trait>(
&'life0 self,
bucket: BucketRef,
object_key: String,
upload_id: String,
parts: Vec<UploadedPart>,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<ObjectVersion, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn abort_multipart<'life0, 'async_trait>(
&'life0 self,
bucket: BucketRef,
object_key: String,
upload_id: String,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<bool, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn abort_multipart<'life0, 'async_trait>(
&'life0 self,
bucket: BucketRef,
object_key: String,
upload_id: String,
idempotency_key: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<bool, ObjectsError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn put_batch<'life0, 'async_trait>(
&'life0 self,
requests: Vec<PutRequest>,
) -> Pin<Box<dyn Future<Output = Vec<Result<ObjectVersion, ObjectsError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put_batch<'life0, 'async_trait>(
&'life0 self,
requests: Vec<PutRequest>,
) -> Pin<Box<dyn Future<Output = Vec<Result<ObjectVersion, ObjectsError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_batch<'life0, 'async_trait>(
&'life0 self,
requests: Vec<GetRequest>,
) -> Pin<Box<dyn Future<Output = Vec<Result<BufferedObject, ObjectsError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_batch<'life0, 'async_trait>(
&'life0 self,
requests: Vec<GetRequest>,
) -> Pin<Box<dyn Future<Output = Vec<Result<BufferedObject, ObjectsError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request