pub struct AppState {
pub tools: Vec<ToolInfo>,
pub tool_registry: ToolRegistry,
pub config: Config,
pub provider: Arc<dyn LlmProvider>,
pub sessions: Arc<RwLock<HashMap<String, SessionState>>>,
pub event_channels: Arc<RwLock<HashMap<String, Sender<SseEvent>>>>,
pub metrics: Arc<Metrics>,
pub slash_commands: Arc<Vec<SlashCommandInfo>>,
}Expand description
Shared application state for the HTTP server.
Fields§
§tools: Vec<ToolInfo>§tool_registry: ToolRegistryLive tool registry used to construct per-request and per-session AgentRuntimes. Without this, runtimes get an empty registry and every tool_call from the LLM resolves to “tool not found”.
config: Config§provider: Arc<dyn LlmProvider>§sessions: Arc<RwLock<HashMap<String, SessionState>>>Session state keyed by session ID.
event_channels: Arc<RwLock<HashMap<String, Sender<SseEvent>>>>Per-session SSE broadcast channels.
metrics: Arc<Metrics>§slash_commands: Arc<Vec<SlashCommandInfo>>Goal-169: registered slash commands (built-in + skill-backed).
Pre-built at startup for cheap GET /slash-commands responses.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AppState
impl !UnwindSafe for AppState
impl Freeze for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more