Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

A configured Objects account client.

Implementations§

Source§

impl Client

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn snapshot(&self, reference: SnapshotRef) -> Snapshot

Reconstruct a read-only snapshot handle from its exact persisted identity.

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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,

Create one permanently versioned bucket.
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,

Resolve one exact bucket identity.
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,

Delete one empty exact bucket identity.
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,

Create one immutable version.
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,

Read one immutable version or its visible current selection.
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,

Create a delete marker or delete one exact version.
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,

Capture or continue one stable listing.
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,

Atomically capture an immutable whole-bucket snapshot.
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,

Destroy one exact snapshot identity.
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,

Atomically fork a whole bucket or snapshot into an independent bucket.
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,

Create one multipart upload without publishing a version.
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,

Upload or replace one exact staged part.
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,

List staged parts in ascending part-number order.
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,

Atomically publish a version from exact staged part receipts.
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,

Abort one exact staged upload.
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,

Creates an ordered bounded group of immutable versions. Read more
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,

Reads an ordered bounded group of immutable versions. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more