pub struct StreamingDisplay { /* private fields */ }Expand description
Manages the display of streaming AI responses
Implementations§
Source§impl StreamingDisplay
impl StreamingDisplay
pub fn new() -> Self
Sourcepub fn start_response(&mut self)
pub fn start_response(&mut self)
Start a new response
Sourcepub fn append_text(&mut self, text: &str)
pub fn append_text(&mut self, text: &str)
Append text chunk to the response
Sourcepub fn tool_call_started(&mut self, name: &str, description: &str)
pub fn tool_call_started(&mut self, name: &str, description: &str)
Record a tool call starting
Sourcepub fn tool_call_completed(&mut self, name: &str, result: Option<String>)
pub fn tool_call_completed(&mut self, name: &str, result: Option<String>)
Record a tool call completed
Sourcepub fn tool_call_failed(&mut self, name: &str, error: String)
pub fn tool_call_failed(&mut self, name: &str, error: String)
Record a tool call failed
Sourcepub fn show_thinking(&self, subject: &str)
pub fn show_thinking(&self, subject: &str)
Show thinking/reasoning indicator
Sourcepub fn end_response(&mut self)
pub fn end_response(&mut self)
End the current response
Sourcepub fn handle_error(&mut self, error: &str)
pub fn handle_error(&mut self, error: &str)
Handle an error during streaming
Sourcepub fn state(&self) -> StreamingState
pub fn state(&self) -> StreamingState
Get the current state
Sourcepub fn elapsed_secs(&self) -> u64
pub fn elapsed_secs(&self) -> u64
Get elapsed time since start
Sourcepub fn tool_calls(&self) -> &[ToolCallInfo]
pub fn tool_calls(&self) -> &[ToolCallInfo]
Get tool calls
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamingDisplay
impl RefUnwindSafe for StreamingDisplay
impl Send for StreamingDisplay
impl Sync for StreamingDisplay
impl Unpin for StreamingDisplay
impl UnwindSafe for StreamingDisplay
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> 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