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§
Sourcetype Reader: StorageReader
type Reader: StorageReader
Source used to read from the underlying storage.
Sourcetype Writer: StorageWriter
type Writer: StorageWriter
Handle that can write to the underlying storage.
Required Methods§
Provided Methods§
Sourcefn max_capacity(&self) -> Option<usize>
fn max_capacity(&self) -> Option<usize>
Returns the maximum number of bytes this provider can hold at a time.
Implementors§
Source§impl StorageProvider for MemoryStorageProvider
impl StorageProvider for MemoryStorageProvider
type Reader = MemoryStorage
type Writer = MemoryStorage
Source§impl StorageProvider for TempStorageProvider
Available on crate feature temp-storage
only.
impl StorageProvider for TempStorageProvider
Available on crate feature
temp-storage
only.