ContextFactory

Trait ContextFactory 

Source
pub trait ContextFactory: Send + Sync {
    // Required methods
    fn key(&self) -> &'static str;
    fn create_context(
        &self,
        config: &Value,
        project_root: &Path,
    ) -> CoreResult<Box<dyn ContextErased>>;
}
Expand description

Factory trait for creating contexts from configuration

Required Methods§

Source

fn key(&self) -> &'static str

The type key this factory handles (e.g., “cwd”, “git”, “file”)

Source

fn create_context( &self, config: &Value, project_root: &Path, ) -> CoreResult<Box<dyn ContextErased>>

Create a context instance from JSON configuration

Implementors§