pub trait ObjectClient {
    type GetObjectResult: Stream<Item = ObjectClientResult<GetBodyPart, GetObjectError, Self::ClientError>> + Send;
    type ClientError: Error + Send + Sync + 'static;

    // Required methods
    fn delete_object<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        bucket: &'life1 str,
        key: &'life2 str
    ) -> Pin<Box<dyn Future<Output = ObjectClientResult<DeleteObjectResult, DeleteObjectError, Self::ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_object<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        bucket: &'life1 str,
        key: &'life2 str,
        range: Option<Range<u64>>,
        if_match: Option<ETag>
    ) -> Pin<Box<dyn Future<Output = ObjectClientResult<Self::GetObjectResult, GetObjectError, Self::ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn list_objects<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        bucket: &'life1 str,
        continuation_token: Option<&'life2 str>,
        delimiter: &'life3 str,
        max_keys: usize,
        prefix: &'life4 str
    ) -> Pin<Box<dyn Future<Output = ObjectClientResult<ListObjectsResult, ListObjectsError, Self::ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
    fn head_object<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        bucket: &'life1 str,
        key: &'life2 str
    ) -> Pin<Box<dyn Future<Output = ObjectClientResult<HeadObjectResult, HeadObjectError, Self::ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn put_object<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        bucket: &'life1 str,
        key: &'life2 str,
        params: &'life3 PutObjectParams,
        contents: impl 'async_trait + Stream<Item = impl 'async_trait + AsRef<[u8]> + Send> + Send
    ) -> Pin<Box<dyn Future<Output = ObjectClientResult<PutObjectResult, PutObjectError, Self::ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn get_object_attributes<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        bucket: &'life1 str,
        key: &'life2 str,
        max_parts: Option<usize>,
        part_number_marker: Option<usize>,
        object_attributes: &'life3 [ObjectAttribute]
    ) -> Pin<Box<dyn Future<Output = ObjectClientResult<GetObjectAttributesResult, GetObjectAttributesError, Self::ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

An ObjectClient is an S3-like blob storage interface

Required Associated Types§

Required Methods§

source

fn delete_object<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, bucket: &'life1 str, key: &'life2 str ) -> Pin<Box<dyn Future<Output = ObjectClientResult<DeleteObjectResult, DeleteObjectError, Self::ClientError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Delete a single object from the object store.

DeleteObject will succeed even if the object within the bucket does not exist.

source

fn get_object<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, bucket: &'life1 str, key: &'life2 str, range: Option<Range<u64>>, if_match: Option<ETag> ) -> Pin<Box<dyn Future<Output = ObjectClientResult<Self::GetObjectResult, GetObjectError, Self::ClientError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get an object from the object store. Returns a stream of body parts of the object. Parts are guaranteed to be returned by the stream in order and contiguously.

source

fn list_objects<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, bucket: &'life1 str, continuation_token: Option<&'life2 str>, delimiter: &'life3 str, max_keys: usize, prefix: &'life4 str ) -> Pin<Box<dyn Future<Output = ObjectClientResult<ListObjectsResult, ListObjectsError, Self::ClientError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

List the objects in a bucket under a given prefix

source

fn head_object<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, bucket: &'life1 str, key: &'life2 str ) -> Pin<Box<dyn Future<Output = ObjectClientResult<HeadObjectResult, HeadObjectError, Self::ClientError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Retrieve object metadata without retrieving the object contents

source

fn put_object<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, bucket: &'life1 str, key: &'life2 str, params: &'life3 PutObjectParams, contents: impl 'async_trait + Stream<Item = impl 'async_trait + AsRef<[u8]> + Send> + Send ) -> Pin<Box<dyn Future<Output = ObjectClientResult<PutObjectResult, PutObjectError, Self::ClientError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Put an object into the object store. The contents are provided by the client as an async stream of buffers.

source

fn get_object_attributes<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, bucket: &'life1 str, key: &'life2 str, max_parts: Option<usize>, part_number_marker: Option<usize>, object_attributes: &'life3 [ObjectAttribute] ) -> Pin<Box<dyn Future<Output = ObjectClientResult<GetObjectAttributesResult, GetObjectAttributesError, Self::ClientError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Retrieves all the metadata from an object without returning the object contents.

Implementations on Foreign Types§

source§

impl<T: ObjectClient + ?Sized> ObjectClient for Arc<T>

§

type GetObjectResult = <T as ObjectClient>::GetObjectResult

§

type ClientError = <T as ObjectClient>::ClientError

source§

fn delete_object<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, bucket: &'life1 str, key: &'life2 str ) -> Pin<Box<dyn Future<Output = ObjectClientResult<DeleteObjectResult, DeleteObjectError, Self::ClientError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn get_object<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, bucket: &'life1 str, key: &'life2 str, range: Option<Range<u64>>, if_match: Option<ETag> ) -> Pin<Box<dyn Future<Output = ObjectClientResult<Self::GetObjectResult, GetObjectError, Self::ClientError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn list_objects<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, bucket: &'life1 str, continuation_token: Option<&'life2 str>, delimiter: &'life3 str, max_keys: usize, prefix: &'life4 str ) -> Pin<Box<dyn Future<Output = ObjectClientResult<ListObjectsResult, ListObjectsError, Self::ClientError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

source§

fn head_object<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, bucket: &'life1 str, key: &'life2 str ) -> Pin<Box<dyn Future<Output = ObjectClientResult<HeadObjectResult, HeadObjectError, Self::ClientError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn put_object<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, bucket: &'life1 str, key: &'life2 str, params: &'life3 PutObjectParams, contents: impl 'async_trait + Stream<Item = impl 'async_trait + AsRef<[u8]> + Send> + Send ) -> Pin<Box<dyn Future<Output = ObjectClientResult<PutObjectResult, PutObjectError, Self::ClientError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

source§

fn get_object_attributes<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, bucket: &'life1 str, key: &'life2 str, max_parts: Option<usize>, part_number_marker: Option<usize>, object_attributes: &'life3 [ObjectAttribute] ) -> Pin<Box<dyn Future<Output = ObjectClientResult<GetObjectAttributesResult, GetObjectAttributesError, Self::ClientError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Implementors§

source§

impl ObjectClient for MockClient

source§

impl ObjectClient for S3CrtClient

§

type GetObjectResult = GetObjectRequest

§

type ClientError = S3RequestError

source§

impl<Client, State, GetWrapperState> ObjectClient for FailureClient<Client, State, GetWrapperState>where Client: ObjectClient + Send + Sync + 'static, State: Send + Sync + 'static, GetWrapperState: Send + Sync + 'static,

§

type GetObjectResult = FailureGetResult<Client, GetWrapperState>

§

type ClientError = <Client as ObjectClient>::ClientError