pub struct S3Storage { /* private fields */ }Implementations§
Source§impl S3Storage
impl S3Storage
Sourcepub async fn from_config(config: S3StorageConfig) -> Result<Self, String>
pub async fn from_config(config: S3StorageConfig) -> Result<Self, String>
Build a storage instance from a configuration object.
Trait Implementations§
Source§impl StorageProvider for S3Storage
impl StorageProvider for S3Storage
Source§fn save_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
building_id: Uuid,
filename: &'life1 str,
content: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
building_id: Uuid,
filename: &'life1 str,
content: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Persist a file and return the relative path that can later be used to read/delete it.
Source§fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
relative_path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_file<'life0, 'life1, 'async_trait>(
&'life0 self,
relative_path: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve the raw bytes and return them as a vector.
Auto Trait Implementations§
impl Freeze for S3Storage
impl !RefUnwindSafe for S3Storage
impl Send for S3Storage
impl Sync for S3Storage
impl Unpin for S3Storage
impl UnsafeUnpin for S3Storage
impl !UnwindSafe 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
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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.