pub struct CommandExecutionContext {
pub session_id: SessionId,
pub host: Arc<dyn CommandHost>,
}Expand description
Context handed to crate::capabilities::Capability::execute_command when a
system command is dispatched. Carries only data that is safe to expose
across the trait surface; capabilities that need handles to host-internal
state (provider store, file system, etc.) own those references directly via
the capability’s constructor. Context-aware commands (out-of-band LLM call
over the session’s context, e.g. /btw) use the host facilities instead —
see crate::command_host::CommandHost.
Fields§
§session_id: SessionIdSession the command is being executed against.
host: Arc<dyn CommandHost>Host facilities: turn-context assembly and tool-less session
completions. Hosts that cannot provide them use
crate::command_host::DisabledCommandHost.
Implementations§
Source§impl CommandExecutionContext
impl CommandExecutionContext
pub fn new(session_id: SessionId, host: Arc<dyn CommandHost>) -> Self
Sourcepub fn without_host(session_id: SessionId) -> Self
pub fn without_host(session_id: SessionId) -> Self
Context for hosts that dispatch commands without turn-context/LLM facilities; context-aware commands then fail with a clear error.
Trait Implementations§
Source§impl Clone for CommandExecutionContext
impl Clone for CommandExecutionContext
Source§fn clone(&self) -> CommandExecutionContext
fn clone(&self) -> CommandExecutionContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for CommandExecutionContext
impl !UnwindSafe for CommandExecutionContext
impl Freeze for CommandExecutionContext
impl Send for CommandExecutionContext
impl Sync for CommandExecutionContext
impl Unpin for CommandExecutionContext
impl UnsafeUnpin for CommandExecutionContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request