StorageProvider

Trait StorageProvider 

Source
pub trait StorageProvider: Send {
    type Reader: StorageReader;
    type Writer: StorageWriter;

    // Required method
    fn into_reader_writer(
        self,
        content_length: Option<u64>,
    ) -> Result<(Self::Reader, Self::Writer)>;

    // Provided method
    fn max_capacity(&self) -> Option<usize> { ... }
}
Expand description

Creates a StorageReader and StorageWriter based on the content length returned from the SourceStream. The reader and writer must track their position in the stream independently.

Required Associated Types§

Source

type Reader: StorageReader

Source used to read from the underlying storage.

Source

type Writer: StorageWriter

Handle that can write to the underlying storage.

Required Methods§

Source

fn into_reader_writer( self, content_length: Option<u64>, ) -> Result<(Self::Reader, Self::Writer)>

Turn the provider into a reader and writer.

Provided Methods§

Source

fn max_capacity(&self) -> Option<usize>

Returns the maximum number of bytes this provider can hold at a time.

Implementors§