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§
Sourcefn read_content(&self, source: &str) -> Result<String, ServiceError>
fn read_content(&self, source: &str) -> Result<String, ServiceError>
Read content from a source (could be file, memory, network, etc.)
Sourcefn write_content(
&self,
destination: &str,
content: &str,
) -> Result<(), ServiceError>
fn write_content( &self, destination: &str, content: &str, ) -> Result<(), ServiceError>
Write content to a destination
Sourcefn list_sources(&self) -> Result<Vec<String>, ServiceError>
fn list_sources(&self) -> Result<Vec<String>, ServiceError>
List available sources (files, URLs, etc.)