pub struct CommandContext {
pub session_id: String,
pub workspace: String,
pub model: String,
pub history_len: usize,
pub total_tokens: u64,
pub total_cost: f64,
pub tool_names: Vec<String>,
pub mcp_servers: Vec<(String, usize)>,
}Expand description
Context passed to every slash command execution.
Fields§
§session_id: StringCurrent session ID.
workspace: StringWorkspace path.
model: StringCurrent model identifier (e.g., “openai/kimi-k2.5”).
history_len: usizeNumber of messages in history.
total_tokens: u64Total tokens used in this session.
total_cost: f64Estimated cost in USD.
tool_names: Vec<String>Registered tool names (builtin + MCP).
mcp_servers: Vec<(String, usize)>Connected MCP servers and their tool counts: (server_name, tool_count).
Trait Implementations§
Source§impl Clone for CommandContext
impl Clone for CommandContext
Source§fn clone(&self) -> CommandContext
fn clone(&self) -> CommandContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CommandContext
impl RefUnwindSafe for CommandContext
impl Send for CommandContext
impl Sync for CommandContext
impl Unpin for CommandContext
impl UnsafeUnpin for CommandContext
impl UnwindSafe for CommandContext
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
Mutably borrows from an owned value. Read more