Skip to main content

CodeModeSession

Trait CodeModeSession 

Source
pub trait CodeModeSession: Send + Sync {
    // Required methods
    fn execute<'a>(
        &'a self,
        request: ExecuteRequest,
    ) -> Pin<Box<dyn Future<Output = Result<StartedCell, String>> + Send + 'a>>;
    fn wait<'a>(
        &'a self,
        request: WaitRequest,
    ) -> Pin<Box<dyn Future<Output = Result<WaitOutcome, String>> + Send + 'a>>;
    fn terminate<'a>(
        &'a self,
        cell_id: CellId,
    ) -> Pin<Box<dyn Future<Output = Result<WaitOutcome, String>> + Send + 'a>>;
    fn shutdown<'a>(
        &'a self,
    ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'a>>;
}
Expand description

A durable code-mode session owned by one Codex thread.

Cells executed in the same session share stored values. Separate sessions must keep those values isolated. Implementations may execute cells in-process or remotely.

Required Methods§

Source

fn execute<'a>( &'a self, request: ExecuteRequest, ) -> Pin<Box<dyn Future<Output = Result<StartedCell, String>> + Send + 'a>>

Source

fn wait<'a>( &'a self, request: WaitRequest, ) -> Pin<Box<dyn Future<Output = Result<WaitOutcome, String>> + Send + 'a>>

Source

fn terminate<'a>( &'a self, cell_id: CellId, ) -> Pin<Box<dyn Future<Output = Result<WaitOutcome, String>> + Send + 'a>>

Source

fn shutdown<'a>( &'a self, ) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'a>>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§