Skip to main content

AdapterContext

Trait AdapterContext 

Source
pub trait AdapterContext: Send {
    // Required methods
    fn get_platform_id(
        &self,
        slug: &str,
        platform: &str,
    ) -> Result<Option<String>, Error>;
    fn normalize_terms(&self, terms: &[String]) -> Vec<String>;
    fn published(&self) -> bool;
    fn storage_config(&self) -> Option<&StorageConfig>;
    fn theme_id(&self) -> Option<&str>;
    fn content_info(&self) -> &ContentInfo;

    // Provided methods
    fn status_tracker(&self) -> Option<&StatusTracker> { ... }
    fn is_dry_run(&self) -> bool { ... }
}
Expand description

Context provided by pipeline to adapters.

Required Methods§

Source

fn get_platform_id( &self, slug: &str, platform: &str, ) -> Result<Option<String>, Error>

Source

fn normalize_terms(&self, terms: &[String]) -> Vec<String>

Source

fn published(&self) -> bool

Source

fn storage_config(&self) -> Option<&StorageConfig>

Source

fn theme_id(&self) -> Option<&str>

Source

fn content_info(&self) -> &ContentInfo

Provided Methods§

Source

fn status_tracker(&self) -> Option<&StatusTracker>

Get the status tracker for asset upload caching. Per [[RFC-0004:C-UPLOAD-TRACKING]].

Source

fn is_dry_run(&self) -> bool

Whether we’re in dry-run mode. In dry-run mode, asset uploads should be mocked (copied to temp dir) instead of actually uploading to remote storage.

Implementors§