pub struct ChatView { /* private fields */ }Expand description
Chat view component for displaying conversation messages
Implementations§
Source§impl ChatView
impl ChatView
pub fn new() -> Self
Sourcepub fn add_message(&mut self, message: Message)
pub fn add_message(&mut self, message: Message)
Add a message to the chat
Sourcepub fn append_to_last_assistant(&mut self, content: &str)
pub fn append_to_last_assistant(&mut self, content: &str)
Append content to the last assistant message, or create a new one if none exists
Sourcepub fn message_count(&self) -> usize
pub fn message_count(&self) -> usize
Get the number of messages
Sourcepub fn scroll_down(&mut self)
pub fn scroll_down(&mut self)
Scroll down by multiple lines
Sourcepub fn scroll_page_up(&mut self, viewport_height: u16)
pub fn scroll_page_up(&mut self, viewport_height: u16)
Scroll up by one page (viewport height)
Sourcepub fn scroll_page_down(&mut self, viewport_height: u16)
pub fn scroll_page_down(&mut self, viewport_height: u16)
Scroll down by one page
Sourcepub fn scroll_to_bottom(&mut self)
pub fn scroll_to_bottom(&mut self)
Scroll to the bottom (show newest messages)
Sourcepub fn scroll_to_top(&mut self)
pub fn scroll_to_top(&mut self)
Scroll to the top (show oldest messages)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ChatView
impl !RefUnwindSafe for ChatView
impl Send for ChatView
impl !Sync for ChatView
impl Unpin for ChatView
impl UnsafeUnpin for ChatView
impl UnwindSafe for ChatView
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,
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