pub trait S3Store: Send + Sync {
Show 14 methods
// Required methods
fn load(&self) -> StoreResult<S3State>;
fn put_bucket_meta(
&self,
bucket: &str,
meta: &BucketMeta,
) -> StoreResult<()>;
fn put_bucket_subresource(
&self,
bucket: &str,
kind: BucketSubresource,
payload: &str,
) -> StoreResult<()>;
fn delete_bucket_subresource(
&self,
bucket: &str,
kind: BucketSubresource,
) -> StoreResult<()>;
fn delete_bucket(&self, bucket: &str) -> StoreResult<()>;
fn put_object(
&self,
bucket: &str,
key: &str,
version: Option<&str>,
body: BodySource,
meta: &ObjectMeta,
) -> StoreResult<BodyRef>;
fn put_object_meta(
&self,
bucket: &str,
key: &str,
version: Option<&str>,
meta: &ObjectMeta,
) -> StoreResult<()>;
fn delete_object(
&self,
bucket: &str,
key: &str,
version: Option<&str>,
) -> StoreResult<()>;
fn open_object_body(&self, body: &BodyRef) -> StoreResult<Bytes>;
fn mpu_create(
&self,
bucket: &str,
upload_id: &str,
init: &MpuInit,
) -> StoreResult<()>;
fn mpu_put_part(
&self,
bucket: &str,
upload_id: &str,
part_number: u32,
body: BodySource,
etag: &str,
) -> StoreResult<BodyRef>;
fn mpu_abort(&self, bucket: &str, upload_id: &str) -> StoreResult<()>;
fn mpu_complete(
&self,
bucket: &str,
upload_id: &str,
final_key: &str,
version: Option<&str>,
meta: &ObjectMeta,
) -> StoreResult<BodyRef>;
// Provided method
fn spool_dir(&self) -> Option<PathBuf> { ... }
}Required Methods§
fn load(&self) -> StoreResult<S3State>
fn put_bucket_meta(&self, bucket: &str, meta: &BucketMeta) -> StoreResult<()>
fn put_bucket_subresource( &self, bucket: &str, kind: BucketSubresource, payload: &str, ) -> StoreResult<()>
fn delete_bucket_subresource( &self, bucket: &str, kind: BucketSubresource, ) -> StoreResult<()>
fn delete_bucket(&self, bucket: &str) -> StoreResult<()>
fn put_object( &self, bucket: &str, key: &str, version: Option<&str>, body: BodySource, meta: &ObjectMeta, ) -> StoreResult<BodyRef>
fn put_object_meta( &self, bucket: &str, key: &str, version: Option<&str>, meta: &ObjectMeta, ) -> StoreResult<()>
fn delete_object( &self, bucket: &str, key: &str, version: Option<&str>, ) -> StoreResult<()>
fn open_object_body(&self, body: &BodyRef) -> StoreResult<Bytes>
fn mpu_create( &self, bucket: &str, upload_id: &str, init: &MpuInit, ) -> StoreResult<()>
Sourcefn mpu_put_part(
&self,
bucket: &str,
upload_id: &str,
part_number: u32,
body: BodySource,
etag: &str,
) -> StoreResult<BodyRef>
fn mpu_put_part( &self, bucket: &str, upload_id: &str, part_number: u32, body: BodySource, etag: &str, ) -> StoreResult<BodyRef>
Persist a multipart-upload part body. Returns the BodyRef the
service should keep in its in-memory part map: BodyRef::Disk
for disk-backed stores (so subsequent reads stream from the
.bin file instead of holding the part in RAM), or
BodyRef::Memory for memory-mode stores.
fn mpu_abort(&self, bucket: &str, upload_id: &str) -> StoreResult<()>
fn mpu_complete( &self, bucket: &str, upload_id: &str, final_key: &str, version: Option<&str>, meta: &ObjectMeta, ) -> StoreResult<BodyRef>
Provided Methods§
Sourcefn spool_dir(&self) -> Option<PathBuf>
fn spool_dir(&self) -> Option<PathBuf>
Where the streaming dispatch path should spool large request
bodies to disk before handing them to Self::put_object /
Self::mpu_put_part. Returning Some keeps the spool file on
the same filesystem as the final destination so rename(2) is a
metadata-only move; returning None means “use the system temp
dir, the store will read the file back into RAM and unlink it”.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".