BucketClient

Trait BucketClient 

Source
pub trait BucketClient {
    // Required methods
    fn bucket_name(&self) -> &str;
    fn ping<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_objects<'a, 'life0, 'async_trait>(
        &'life0 self,
        options: ListObjectOptions<'a>,
    ) -> Pin<Box<dyn Future<Output = Result<Page<Object>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait;
    fn create_object<'life0, 'life1, 'async_trait, S>(
        &'life0 self,
        key: &'life1 str,
        value: S,
    ) -> Pin<Box<dyn Future<Output = Result<Object, Error>> + Send + 'async_trait>>
       where S: TryStream + Send + Sync + 'static + 'async_trait,
             S::Error: Into<Box<dyn Error + Send + Sync>>,
             Bytes: From<S::Ok>,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_object<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Object, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn download_object<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<Bytes, Error>>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_object<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A GCS client that targets a specific bucket.

Required Methods§

Source

fn bucket_name(&self) -> &str

Returns the name of the bucket to which this BucketClient is connected.

Source

fn ping<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Checks connectivity to the bucket.

Source

fn list_objects<'a, 'life0, 'async_trait>( &'life0 self, options: ListObjectOptions<'a>, ) -> Pin<Box<dyn Future<Output = Result<Page<Object>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Returns a page of objects.

Source

fn create_object<'life0, 'life1, 'async_trait, S>( &'life0 self, key: &'life1 str, value: S, ) -> Pin<Box<dyn Future<Output = Result<Object, Error>> + Send + 'async_trait>>
where S: TryStream + Send + Sync + 'static + 'async_trait, S::Error: Into<Box<dyn Error + Send + Sync>>, Bytes: From<S::Ok>, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Creates a new object.

Source

fn get_object<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Object, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Gets an object’s metadata.

Source

fn download_object<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<Bytes, Error>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Downloads an object.

Source

fn delete_object<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Deletes an object. This library does not consider deleting a non-existent object an error.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§