Skip to main content

Uploader

Trait Uploader 

Source
pub trait Uploader: Send + Sync {
    // Required methods
    fn upload_with(
        &self,
        key: &str,
        data: Vec<u8>,
        options: UploadOptions,
    ) -> impl Future<Output = Result<ObjectAttrs, Error>> + Send;
    fn upload_stream(
        &self,
        key: &str,
        reader: impl AsyncRead + Unpin + Send + Sync + 'static,
        options: UploadOptions,
    ) -> impl Future<Output = Result<ObjectAttrs, Error>> + Send;

    // Provided methods
    fn upload(
        &self,
        key: &str,
        data: Vec<u8>,
    ) -> impl Future<Output = Result<ObjectAttrs, Error>> + Send { ... }
    fn upload_chunks<S, B, E>(
        &self,
        key: &str,
        chunks: S,
        options: UploadOptions,
    ) -> impl Future<Output = Result<ObjectAttrs, Error>> + Send
       where S: Stream<Item = Result<B, E>> + Send + 'static,
             B: Into<Bytes> + 'static,
             E: Into<Box<dyn Error + Send + Sync>> + 'static { ... }
}
Expand description

Upload objects. Implemented by a BucketRef granting perms::Uploader.

Required Methods§

Source

fn upload_with( &self, key: &str, data: Vec<u8>, options: UploadOptions, ) -> impl Future<Output = Result<ObjectAttrs, Error>> + Send

Source

fn upload_stream( &self, key: &str, reader: impl AsyncRead + Unpin + Send + Sync + 'static, options: UploadOptions, ) -> impl Future<Output = Result<ObjectAttrs, Error>> + Send

Provided Methods§

Source

fn upload( &self, key: &str, data: Vec<u8>, ) -> impl Future<Output = Result<ObjectAttrs, Error>> + Send

Source

fn upload_chunks<S, B, E>( &self, key: &str, chunks: S, options: UploadOptions, ) -> impl Future<Output = Result<ObjectAttrs, Error>> + Send
where S: Stream<Item = Result<B, E>> + Send + 'static, B: Into<Bytes> + 'static, E: Into<Box<dyn Error + Send + Sync>> + 'static,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<P: BucketPerms> Uploader for BucketRef<P>
where P::Upload: Granted<Uploader>,