pub struct AppState {
pub llm_service: Arc<RwLock<Service>>,
pub config: Arc<RwLock<Settings>>,
}Expand description
Application state
Fields§
§llm_service: Arc<RwLock<Service>>§config: Arc<RwLock<Settings>>Implementations§
Source§impl AppState
impl AppState
pub fn new(llm_service: LlmService, config: Settings) -> Self
Sourcepub async fn update_llm_service(
&self,
new_backend: &LlmBackendSettings,
) -> Result<()>
pub async fn update_llm_service( &self, new_backend: &LlmBackendSettings, ) -> Result<()>
Dynamically update LLM service configuration
This method allows updating LLM backend configuration at runtime without restarting the service
Sourcepub async fn get_current_config(&self) -> Result<Settings>
pub async fn get_current_config(&self) -> Result<Settings>
Get a copy of the current configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppState
impl !RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl !UnwindSafe 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