Skip to main content

ToolSession

Trait ToolSession 

Source
pub trait ToolSession: Send + Sync {
    // Required methods
    fn cwd(&self) -> &PathBuf;
    fn workspace_root(&self) -> &PathBuf;
    fn record_warning<'life0, 'async_trait>(
        &'life0 self,
        message: String,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn user_shell(&self) -> &str;

    // Provided methods
    fn source_inspection(&self) -> Option<&SourceInspection> { ... }
    fn edited_file_monitor(&self) -> Option<&EditedFileMonitor> { ... }
}
Expand description

Session trait for tool execution context

Required Methods§

Source

fn cwd(&self) -> &PathBuf

Get the current working directory

Source

fn workspace_root(&self) -> &PathBuf

Get workspace root

Source

fn record_warning<'life0, 'async_trait>( &'life0 self, message: String, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Record a warning message

Source

fn user_shell(&self) -> &str

Get user’s configured shell

Provided Methods§

Source

fn source_inspection(&self) -> Option<&SourceInspection>

Session source ledger. Absence fails closed for edits to existing text.

Source

fn edited_file_monitor(&self) -> Option<&EditedFileMonitor>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§