pub struct S3Storage { /* private fields */ }Expand description
S3-compatible durable object storage.
Implementations§
Source§impl S3Storage
impl S3Storage
Sourcepub async fn from_options(options: S3StorageOptions) -> Result<Self>
pub async fn from_options(options: S3StorageOptions) -> Result<Self>
Build an S3 storage client from explicit options.
Source§impl S3Storage
impl S3Storage
Sourcepub async fn create_bucket_if_missing_for_tests(&self) -> Result<()>
pub async fn create_bucket_if_missing_for_tests(&self) -> Result<()>
Create the configured bucket when a test harness owns the object store.
Application startup intentionally does not create buckets; production Compose and external S3 deployments provision storage outside the app.
Trait Implementations§
Source§impl Storage for S3Storage
impl Storage for S3Storage
Source§fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
content: &'life2 [u8],
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
content: &'life2 [u8],
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store content at a storage-relative key. Implementations must not overwrite.
Source§fn put_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
source: &'life2 Path,
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
source: &'life2 Path,
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store a local file at a storage-relative key. Implementations must not overwrite.
Source§fn promote<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
temporary_key: &'life1 StorageKey,
durable_key: &'life2 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn promote<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
temporary_key: &'life1 StorageKey,
durable_key: &'life2 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<StorageKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Promote a temporary object to a durable storage-relative key without overwriting.
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read content from a storage-relative key with an object-size cap.
Source§fn get_to_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
destination: &'life2 Path,
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_to_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
destination: &'life2 Path,
intent: StorageWriteIntent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Download an object into a local file with an object-size cap.
Source§fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return whether a storage-relative key exists.
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a storage-relative key if it exists.
Source§fn list_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<Vec<StorageKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<Vec<StorageKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List object keys below a storage-relative prefix.
Source§fn delete_prefix_older_than<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorageKey,
older_than: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_prefix_older_than<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorageKey,
older_than: SystemTime,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete every object below a storage-relative prefix older than the cutoff.
Source§fn delete_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_prefix<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: &'life1 StorageKey,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete every object below a storage-relative prefix.
Auto Trait Implementations§
impl !RefUnwindSafe for S3Storage
impl !UnwindSafe for S3Storage
impl Freeze for S3Storage
impl Send for S3Storage
impl Sync for S3Storage
impl Unpin for S3Storage
impl UnsafeUnpin for S3Storage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.