Skip to main content

Session

Trait Session 

Source
pub trait Session: Send + Sync {
    // Required methods
    fn resolve_input<'life0, 'life1, 'async_trait>(
        &'life0 self,
        input: &'life1 MCPServerInput,
    ) -> Pin<Box<dyn Future<Output = ComputerResult<Value>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn session_id(&self) -> &str;
}
Expand description

Session trait - 用于抽象不同的交互环境(CLI、GUI、Web) Session trait - Abstract different interaction environments (CLI, GUI, Web)

Required Methods§

Source

fn resolve_input<'life0, 'life1, 'async_trait>( &'life0 self, input: &'life1 MCPServerInput, ) -> Pin<Box<dyn Future<Output = ComputerResult<Value>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

解析输入值 / Resolve input value

Source

fn session_id(&self) -> &str

获取会话ID / Get session ID

Implementors§