pub enum TenantStorageLayer {
S3(S3StorageLayer),
}Variants§
S3(S3StorageLayer)
Storage layer backed by S3
Implementations§
Source§impl TenantStorageLayer
impl TenantStorageLayer
Sourcepub async fn create_bucket(&self) -> Result<()>
pub async fn create_bucket(&self) -> Result<()>
Creates the tenant S3 bucket
Sourcepub async fn delete_bucket(&self) -> Result<()>
pub async fn delete_bucket(&self) -> Result<()>
Deletes the tenant S3 bucket
Sourcepub async fn create_presigned(
&self,
key: &str,
size: i64,
) -> Result<(PresignedRequest, DateTime<Utc>)>
pub async fn create_presigned( &self, key: &str, size: i64, ) -> Result<(PresignedRequest, DateTime<Utc>)>
Create a presigned file upload URL
Sourcepub async fn upload_file(
&self,
key: &str,
content_type: String,
body: Bytes,
) -> Result<()>
pub async fn upload_file( &self, key: &str, content_type: String, body: Bytes, ) -> Result<()>
Uploads a file to the S3 bucket for the tenant
Sourcepub async fn add_bucket_notifications(&self, sns_arn: &str) -> Result<()>
pub async fn add_bucket_notifications(&self, sns_arn: &str) -> Result<()>
Add the SNS notification to a bucket
Sourcepub async fn add_bucket_cors(&self, origins: Vec<String>) -> Result<()>
pub async fn add_bucket_cors(&self, origins: Vec<String>) -> Result<()>
Applies CORS rules for a bucket
Sourcepub async fn delete_file(&self, key: &str) -> Result<()>
pub async fn delete_file(&self, key: &str) -> Result<()>
Deletes the S3 file
Sourcepub async fn get_file(&self, key: &str) -> Result<FileStream>
pub async fn get_file(&self, key: &str) -> Result<FileStream>
Gets a byte stream for a file from S3
Trait Implementations§
Source§impl Clone for TenantStorageLayer
impl Clone for TenantStorageLayer
Source§fn clone(&self) -> TenantStorageLayer
fn clone(&self) -> TenantStorageLayer
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TenantStorageLayer
impl !RefUnwindSafe for TenantStorageLayer
impl Send for TenantStorageLayer
impl Sync for TenantStorageLayer
impl Unpin for TenantStorageLayer
impl !UnwindSafe for TenantStorageLayer
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.