Skip to main content

ExecutionContext

Trait ExecutionContext 

Source
pub trait ExecutionContext {
    // Required methods
    fn read_content(&self, source: &str) -> Result<String, ServiceError>;
    fn write_content(
        &self,
        destination: &str,
        content: &str,
    ) -> Result<(), ServiceError>;
    fn list_sources(&self) -> Result<Vec<String>, ServiceError>;
}
Expand description

Abstract execution context that can provide code from various sources

This trait provides a generic interface for accessing source code from different sources (filesystem, memory, network, etc.) to support different execution environments.

Required Methods§

Source

fn read_content(&self, source: &str) -> Result<String, ServiceError>

Read content from a source (could be file, memory, network, etc.)

Source

fn write_content( &self, destination: &str, content: &str, ) -> Result<(), ServiceError>

Write content to a destination

Source

fn list_sources(&self) -> Result<Vec<String>, ServiceError>

List available sources (files, URLs, etc.)

Implementors§