Trait ContentFormat

Source
pub trait ContentFormat: Debug {
    // Required methods
    fn expected_extensions(&self) -> &[&str];
    fn script_is_acceptable(&self, script: &str) -> bool;
    fn script_to_content(
        &self,
        cxt: &ContextHandle,
        script: &str,
    ) -> Result<Box<dyn Content>, Box<dyn Error>>;

    // Provided method
    fn path_is_acceptable(&self, path: &Path) -> bool { ... }
}

Required Methods§

Source

fn expected_extensions(&self) -> &[&str]

Source

fn script_is_acceptable(&self, script: &str) -> bool

Source

fn script_to_content( &self, cxt: &ContextHandle, script: &str, ) -> Result<Box<dyn Content>, Box<dyn Error>>

Provided Methods§

Source

fn path_is_acceptable(&self, path: &Path) -> bool

Implementors§