pub struct ConversationBuffer { /* private fields */ }Expand description
Renders the scrollable conversation history.
ConversationWindow takes a ConversationBuffer and renders its segments as styled terminal lines. The buffer accumulates streamed content — user messages, assistant text chunks, thoughts, and tool call labels — and the window handles scroll position and viewport clipping.
§Segment types
UserMessage— the user’s submitted prompt, rendered with a distinctive style.Text— assistant markdown, rendered with syntax highlighting viarender_markdown.Thought— reasoning/thinking content, displayed in a collapsible block.ToolCall— a label identifying a tool invocation.
§See also
ConversationScreen— the parent that owns this window
Implementations§
Source§impl ConversationBuffer
impl ConversationBuffer
pub fn new() -> Self
pub fn push_user_message(&mut self, text: &str)
pub fn append_text_chunk(&mut self, chunk: &str)
pub fn append_thought_chunk(&mut self, chunk: &str)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConversationBuffer
impl RefUnwindSafe for ConversationBuffer
impl Send for ConversationBuffer
impl Sync for ConversationBuffer
impl Unpin for ConversationBuffer
impl UnsafeUnpin for ConversationBuffer
impl UnwindSafe for ConversationBuffer
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> 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