pub struct App<I: UiState> {
pub(crate) agent_thread: Option<JoinHandle<()>>,
pub(crate) ui: I,
pub(crate) agent_notifications: UnboundedSender<Notification>,
pub(crate) ui_notifications: UnboundedReceiver<Notification>,
}Expand description
The application state
Fields§
§agent_thread: Option<JoinHandle<()>>Agent thread running concurrently
ui: IUI state
agent_notifications: UnboundedSender<Notification>Notifications to the agent
ui_notifications: UnboundedReceiver<Notification>Notification to the UI
Implementations§
Source§impl<I: UiState> App<I>
impl<I: UiState> App<I>
Sourcepub fn new_with_history<F: FnOnce(&Agent, Arc<Mutex<ChatHistory>>) -> Result<I>>(
agent: Agent,
history: &[ChatMessage],
ui_notifications: NotificationChannel,
create_ui: F,
) -> Result<Self>
pub fn new_with_history<F: FnOnce(&Agent, Arc<Mutex<ChatHistory>>) -> Result<I>>( agent: Agent, history: &[ChatMessage], ui_notifications: NotificationChannel, create_ui: F, ) -> Result<Self>
Create a new application state around agent, pre-feeding the chat log with history.
Trait Implementations§
Auto Trait Implementations§
impl<I> !RefUnwindSafe for App<I>
impl<I> !UnwindSafe for App<I>
impl<I> Freeze for App<I>where
I: Freeze,
impl<I> Send for App<I>where
I: Send,
impl<I> Sync for App<I>where
I: Sync,
impl<I> Unpin for App<I>where
I: Unpin,
impl<I> UnsafeUnpin for App<I>where
I: UnsafeUnpin,
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