pub trait Storage: Send + Sync {
// Required methods
fn read_range(&self, range: Range<u64>) -> BoxFuture<'_, Result<Bytes>>;
fn write(&self, data: Bytes) -> BoxFuture<'_, Result<()>>;
fn size(&self) -> BoxFuture<'_, Result<u64>>;
fn write_multipart(&self) -> BoxFuture<'_, Result<Box<dyn MultipartWriter>>>;
}Expand description
Required Methods§
Sourcefn read_range(&self, range: Range<u64>) -> BoxFuture<'_, Result<Bytes>>
fn read_range(&self, range: Range<u64>) -> BoxFuture<'_, Result<Bytes>>
Reads the byte range range from the file.
Sourcefn write(&self, data: Bytes) -> BoxFuture<'_, Result<()>>
fn write(&self, data: Bytes) -> BoxFuture<'_, Result<()>>
Replaces the entire file content with data.
Sourcefn write_multipart(&self) -> BoxFuture<'_, Result<Box<dyn MultipartWriter>>>
fn write_multipart(&self) -> BoxFuture<'_, Result<Box<dyn MultipartWriter>>>
Begins a streaming write that replaces the file’s contents.
The returned writer accepts successive byte chunks; the upload is
committed once MultipartWriter::complete is awaited. This lets
callers ship large payloads without materializing the whole file in
memory.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".