junobuild_storage::strategies

Trait StorageStateStrategy

Source
pub trait StorageStateStrategy {
    // Required methods
    fn get_content_chunks(
        &self,
        encoding: &AssetEncoding,
        chunk_index: usize,
        memory: &Memory,
    ) -> Option<Blob>;
    fn get_public_asset(
        &self,
        full_path: FullPath,
        token: Option<String>,
    ) -> Option<(Asset, Memory)>;
    fn get_rule(&self, collection: &CollectionKey) -> Result<Rule, String>;
    fn get_config(&self) -> StorageConfig;
    fn get_domains(&self) -> CustomDomains;
    fn get_asset(
        &self,
        collection: &CollectionKey,
        full_path: &FullPath,
        rule: &Rule,
    ) -> Option<Asset>;
    fn insert_asset(
        &self,
        collection: &CollectionKey,
        full_path: &FullPath,
        asset: &Asset,
        rule: &Rule,
    );
    fn delete_asset(
        &self,
        collection: &CollectionKey,
        full_path: &FullPath,
        rule: &Rule,
    ) -> Option<Asset>;
}

Required Methods§

Source

fn get_content_chunks( &self, encoding: &AssetEncoding, chunk_index: usize, memory: &Memory, ) -> Option<Blob>

Source

fn get_public_asset( &self, full_path: FullPath, token: Option<String>, ) -> Option<(Asset, Memory)>

Source

fn get_rule(&self, collection: &CollectionKey) -> Result<Rule, String>

Source

fn get_config(&self) -> StorageConfig

Source

fn get_domains(&self) -> CustomDomains

Source

fn get_asset( &self, collection: &CollectionKey, full_path: &FullPath, rule: &Rule, ) -> Option<Asset>

Source

fn insert_asset( &self, collection: &CollectionKey, full_path: &FullPath, asset: &Asset, rule: &Rule, )

Source

fn delete_asset( &self, collection: &CollectionKey, full_path: &FullPath, rule: &Rule, ) -> Option<Asset>

Implementors§