pub struct AppCore {
models: ModelService,
settings: SettingsService,
servers: ServerService,
chat_history: ChatHistoryService,
}Expand description
The core application facade.
AppCore provides access to all core services. It’s constructed at the
adapter’s composition root (main.rs or bootstrap.rs) with concrete
implementations of repositories and runners.
§Example
ⓘ
let repos = Repos { models: model_repo, settings: settings_repo };
let runner = Arc::new(LlamaServerRunner::new(...));
let core = AppCore::new(repos, runner);
// Access services
let models = core.models().list().await?;Fields§
§models: ModelService§settings: SettingsService§servers: ServerService§chat_history: ChatHistoryServiceImplementations§
Source§impl AppCore
impl AppCore
Sourcepub fn new(repos: Repos, runner: Arc<dyn ProcessRunner>) -> Self
pub fn new(repos: Repos, runner: Arc<dyn ProcessRunner>) -> Self
Create a new AppCore with the given repositories and process runner.
Sourcepub const fn models(&self) -> &ModelService
pub const fn models(&self) -> &ModelService
Access the model service.
Sourcepub const fn settings(&self) -> &SettingsService
pub const fn settings(&self) -> &SettingsService
Access the settings service.
Sourcepub const fn servers(&self) -> &ServerService
pub const fn servers(&self) -> &ServerService
Access the server service.
Sourcepub const fn chat_history(&self) -> &ChatHistoryService
pub const fn chat_history(&self) -> &ChatHistoryService
Access the chat history service.
Auto Trait Implementations§
impl Freeze for AppCore
impl !RefUnwindSafe for AppCore
impl Send for AppCore
impl Sync for AppCore
impl Unpin for AppCore
impl !UnwindSafe for AppCore
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