pub struct Storage { /* private fields */ }Implementations§
Source§impl Storage
impl Storage
pub fn new(store: impl Store) -> Self
pub fn with_clock(self, clock: Clock) -> Self
pub async fn put(&self) -> Result<Put>
pub async fn get(&self, key: &StorageKey) -> Result<Option<Content>>
pub async fn delete(&self, key: &StorageKey) -> Result<()>
pub async fn exists(&self, key: &StorageKey) -> Result<bool>
Sourcepub fn download_url(
&self,
key: &StorageKey,
content_type: &ContentType,
valid_for: Duration,
) -> Result<String>
pub fn download_url( &self, key: &StorageKey, content_type: &ContentType, valid_for: Duration, ) -> Result<String>
Opens the file to whoever holds the link until it expires; served as content_type only
when that cannot run as a page.
Sourcepub fn named_download_url(
&self,
key: &StorageKey,
content_type: &ContentType,
filename: &str,
valid_for: Duration,
) -> Result<String>
pub fn named_download_url( &self, key: &StorageKey, content_type: &ContentType, filename: &str, valid_for: Duration, ) -> Result<String>
As download_url, saved by the browser as filename, such as an upload’s own name.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Storage
impl !UnwindSafe for Storage
impl Freeze for Storage
impl Send for Storage
impl Sync for Storage
impl Unpin for Storage
impl UnsafeUnpin 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