pub trait CommandHost: Send + Sync {
// Required methods
fn turn_context<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CommandTurnContext>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn completion<'life0, 'async_trait>(
&'life0 self,
request: SessionCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<SessionCompletion, SessionCompletionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn completion_stream<'life0, 'async_trait>(
&'life0 self,
_request: SessionCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<SessionCompletionStream, SessionCompletionError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Host facilities available to capability command implementations.
Completions are out-of-band: this contract does not persist messages or
events. Hosts without these facilities use DisabledCommandHost.
Required Methods§
Sourcefn turn_context<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CommandTurnContext>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn turn_context<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<CommandTurnContext>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Assemble the credential-free context a main turn would see.
Sourcefn completion<'life0, 'async_trait>(
&'life0 self,
request: SessionCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<SessionCompletion, SessionCompletionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn completion<'life0, 'async_trait>(
&'life0 self,
request: SessionCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<SessionCompletion, SessionCompletionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run a tool-less completion against the resolved session model.
Provided Methods§
Sourcefn completion_stream<'life0, 'async_trait>(
&'life0 self,
_request: SessionCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<SessionCompletionStream, SessionCompletionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn completion_stream<'life0, 'async_trait>(
&'life0 self,
_request: SessionCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<SessionCompletionStream, SessionCompletionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stream a tool-less completion. The default advertises an unsupported
capability so commands can fall back to Self::completion.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".