Struct create_rust_app::Storage
source · pub struct Storage { /* private fields */ }
Implementations§
source§impl Storage
impl Storage
pub async fn download( &self, key: String, to_path: PathBuf ) -> Result<(), String>
sourcepub async fn download_uri(
&self,
key: String,
expires_in: Option<Duration>
) -> Result<String, String>
pub async fn download_uri( &self, key: String, expires_in: Option<Duration> ) -> Result<String, String>
if expires_in
is None
, then we assume the bucket is publicly accessible and return the
public URL. For this to work, you have to make sure the bucket’s policy allows public access.
pub async fn upload( &self, key: String, bytes: Vec<u8>, content_type: String, _content_md5: String ) -> Result<(), String>
pub async fn upload_uri( &self, key: String, expires_in: Duration ) -> Result<UploadURI, String>
pub async fn delete(&self, key: String) -> Result<(), String>
pub async fn delete_many(&self, keys: Vec<String>) -> Result<(), String>
pub fn new() -> Storage
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl !UnwindSafe for Storage
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> 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> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
T: SqlType + TypedExpressionType,
fn into_sql<T>(self) -> Self::Expressionwhere Self: AsExpression<T> + Sized, T: SqlType + TypedExpressionType,
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
T: SqlType + TypedExpressionType,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,
Convert
&self
to an expression for Diesel’s query builder. Read more