pub enum TenantStorageLayer {
S3(S3StorageLayer),
}Expand description
Storage layer for a tenant with different underlying backends
Variants§
S3(S3StorageLayer)
Storage layer backed by S3
Implementations§
Source§impl TenantStorageLayer
impl TenantStorageLayer
Sourcepub async fn create_bucket(
&self,
) -> Result<CreateBucketOutcome, StorageLayerError>
pub async fn create_bucket( &self, ) -> Result<CreateBucketOutcome, StorageLayerError>
Creates the tenant storage bucket
In the event that the bucket already exists, this is treated as a
Ok result rather than an error
Sourcepub async fn bucket_exists(&self) -> Result<bool, StorageLayerError>
pub async fn bucket_exists(&self) -> Result<bool, StorageLayerError>
Checks if the bucket exists
Sourcepub async fn delete_bucket(&self) -> Result<(), StorageLayerError>
pub async fn delete_bucket(&self) -> Result<(), StorageLayerError>
Deletes the tenant storage bucket
In the event that the bucket did not exist before calling this
function this is treated as an Ok result
Sourcepub async fn create_presigned(
&self,
key: &str,
size: i64,
) -> Result<(PresignedRequest, DateTime<Utc>), StorageLayerError>
pub async fn create_presigned( &self, key: &str, size: i64, ) -> Result<(PresignedRequest, DateTime<Utc>), StorageLayerError>
Create a presigned file upload URL
Sourcepub async fn create_presigned_download(
&self,
key: &str,
expires_in: Duration,
) -> Result<(PresignedRequest, DateTime<Utc>), StorageLayerError>
pub async fn create_presigned_download( &self, key: &str, expires_in: Duration, ) -> Result<(PresignedRequest, DateTime<Utc>), StorageLayerError>
Create a presigned file download URL
Presigned download creation will succeed even if the requested key is not present
Sourcepub async fn upload_file(
&self,
key: &str,
content_type: String,
body: Bytes,
) -> Result<(), StorageLayerError>
pub async fn upload_file( &self, key: &str, content_type: String, body: Bytes, ) -> Result<(), StorageLayerError>
Uploads a file to the S3 bucket for the tenant
Sourcepub async fn add_bucket_notifications(
&self,
sns_arn: &str,
) -> Result<(), StorageLayerError>
pub async fn add_bucket_notifications( &self, sns_arn: &str, ) -> Result<(), StorageLayerError>
Add the SNS notification to a bucket
Sourcepub async fn set_bucket_cors_origins(
&self,
origins: Vec<String>,
) -> Result<(), StorageLayerError>
pub async fn set_bucket_cors_origins( &self, origins: Vec<String>, ) -> Result<(), StorageLayerError>
Sets the allowed CORS origins for accessing the storage from the frontend
Sourcepub async fn delete_file(&self, key: &str) -> Result<(), StorageLayerError>
pub async fn delete_file(&self, key: &str) -> Result<(), StorageLayerError>
Deletes the file with the provided key
In the event that the file did not exist before calling this
function this is treated as an Ok result
Sourcepub async fn get_file(&self, key: &str) -> Result<FileStream, StorageLayerError>
pub async fn get_file(&self, key: &str) -> Result<FileStream, StorageLayerError>
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
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>
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>
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 more