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;
    fn send_event<'life0, 'async_trait>(
        &'life0 self,
        event: ToolEvent,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
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

Source

fn send_event<'life0, 'async_trait>( &'life0 self, event: ToolEvent, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send an event

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§