Skip to main content

Store

Trait Store 

Source
pub trait Store:
    Send
    + Sync
    + 'static {
    // Required methods
    fn writer(&self, key: &StorageKey) -> Pending<'_, Box<dyn Writer>>;
    fn reader(&self, key: &StorageKey) -> Pending<'_, Option<Box<dyn Reader>>>;
    fn delete(&self, key: &StorageKey) -> Pending<'_, ()>;
    fn exists(&self, key: &StorageKey) -> Pending<'_, bool>;
    fn download_url(&self, link: &DownloadLink<'_>) -> Result<String>;

    // Provided method
    fn served(&self, _path_and_query: &str, _now: Timestamp) -> Option<Served> { ... }
}

Required Methods§

Source

fn writer(&self, key: &StorageKey) -> Pending<'_, Box<dyn Writer>>

Source

fn reader(&self, key: &StorageKey) -> Pending<'_, Option<Box<dyn Reader>>>

Source

fn delete(&self, key: &StorageKey) -> Pending<'_, ()>

Deleting a key that holds nothing succeeds.

Source

fn exists(&self, key: &StorageKey) -> Pending<'_, bool>

Source

fn download_url(&self, link: &DownloadLink<'_>) -> Result<String>

Provided Methods§

Source

fn served(&self, _path_and_query: &str, _now: Timestamp) -> Option<Served>

The file a link this store signed for the app itself to serve names, while it is valid.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§