Skip to main content

AgentExecutionEnvironment

Trait AgentExecutionEnvironment 

Source
pub trait AgentExecutionEnvironment: Send + Sync {
    // Required methods
    fn cwd(&self) -> Option<&EnvironmentPath>;
    fn create_dir_all<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 EnvironmentPath,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn write_file<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        path: &'life1 EnvironmentPath,
        content: &'life2 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn read_file<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 EnvironmentPath,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn remove<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 EnvironmentPath,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn create_temp_dir<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prefix: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<EnvironmentPath>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn exec<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: ExecRequest,
        sink: &'life1 mut dyn ExecEventSink,
    ) -> Pin<Box<dyn Future<Output = Result<ExecOutput>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn spawn<'life0, 'async_trait>(
        &'life0 self,
        request: ExecRequest,
        sink: Option<Box<dyn ExecEventSink>>,
    ) -> Pin<Box<dyn Future<Output = Result<SpawnOutput>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn cwd(&self) -> Option<&EnvironmentPath>

Source

fn create_dir_all<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 EnvironmentPath, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn write_file<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, path: &'life1 EnvironmentPath, content: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn read_file<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 EnvironmentPath, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn remove<'life0, 'life1, 'async_trait>( &'life0 self, path: &'life1 EnvironmentPath, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn create_temp_dir<'life0, 'life1, 'async_trait>( &'life0 self, prefix: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<EnvironmentPath>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn exec<'life0, 'life1, 'async_trait>( &'life0 self, request: ExecRequest, sink: &'life1 mut dyn ExecEventSink, ) -> Pin<Box<dyn Future<Output = Result<ExecOutput>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn spawn<'life0, 'async_trait>( &'life0 self, request: ExecRequest, sink: Option<Box<dyn ExecEventSink>>, ) -> Pin<Box<dyn Future<Output = Result<SpawnOutput>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§