pub struct PiConsole { /* private fields */ }Expand description
Pi’s console wrapper providing styled terminal output.
Implementations§
Source§impl PiConsole
impl PiConsole
Sourcepub fn new_with_theme(_theme: Option<Theme>) -> Self
pub fn new_with_theme(_theme: Option<Theme>) -> Self
Create a new Pi console with an optional theme.
Sourcepub fn with_color() -> Self
pub fn with_color() -> Self
Create a console with forced color output (for testing).
Sourcepub const fn is_terminal(&self) -> bool
pub const fn is_terminal(&self) -> bool
Check if we’re running in a terminal.
Sourcepub fn print_plain(&self, text: &str)
pub fn print_plain(&self, text: &str)
Print plain text without any styling.
Sourcepub fn print_markup(&self, markup: &str)
pub fn print_markup(&self, markup: &str)
Print text with rich markup (if TTY).
Sourcepub fn render_markdown(&self, markdown: &str)
pub fn render_markdown(&self, markdown: &str)
Render Markdown (TTY → styled output; non-TTY → raw Markdown).
Sourcepub fn render_text_delta(&self, text: &str)
pub fn render_text_delta(&self, text: &str)
Render streaming text from the assistant.
Sourcepub fn render_thinking_delta(&self, text: &str)
pub fn render_thinking_delta(&self, text: &str)
Render streaming thinking text (dimmed).
Sourcepub fn render_thinking_start(&self)
pub fn render_thinking_start(&self)
Render the start of a thinking block.
Sourcepub fn render_thinking_end(&self)
pub fn render_thinking_end(&self)
Render the end of a thinking block.
Sourcepub fn render_tool_start(&self, name: &str, _input: &str)
pub fn render_tool_start(&self, name: &str, _input: &str)
Render tool execution start.
Sourcepub fn render_tool_end(&self, name: &str, is_error: bool)
pub fn render_tool_end(&self, name: &str, is_error: bool)
Render tool execution end.
Sourcepub fn render_error(&self, error: &str)
pub fn render_error(&self, error: &str)
Render an error message.
Sourcepub fn render_warning(&self, warning: &str)
pub fn render_warning(&self, warning: &str)
Render a warning message.
Sourcepub fn render_success(&self, message: &str)
pub fn render_success(&self, message: &str)
Render a success message.
Sourcepub fn render_info(&self, message: &str)
pub fn render_info(&self, message: &str)
Render an info message.
Sourcepub fn render_panel(&self, content: &str, title: &str)
pub fn render_panel(&self, content: &str, title: &str)
Render a panel with a title.
Sourcepub fn render_table(&self, headers: &[&str], rows: &[Vec<&str>])
pub fn render_table(&self, headers: &[&str], rows: &[Vec<&str>])
Render a table.
Sourcepub fn render_rule(&self, title: Option<&str>)
pub fn render_rule(&self, title: Option<&str>)
Render a horizontal rule.
Sourcepub fn render_usage(
&self,
input_tokens: u32,
output_tokens: u32,
cost_usd: Option<f64>,
)
pub fn render_usage( &self, input_tokens: u32, output_tokens: u32, cost_usd: Option<f64>, )
Render token usage statistics.
Sourcepub fn render_session_info(&self, session_path: &str, message_count: usize)
pub fn render_session_info(&self, session_path: &str, message_count: usize)
Render session info.
Sourcepub fn render_model_info(&self, model: &str, thinking_level: Option<&str>)
pub fn render_model_info(&self, model: &str, thinking_level: Option<&str>)
Render model info.
Sourcepub fn render_prompt(&self)
pub fn render_prompt(&self)
Render the input prompt.
Sourcepub fn render_user_message(&self, message: &str)
pub fn render_user_message(&self, message: &str)
Render a user message echo.
Sourcepub fn render_assistant_start(&self)
pub fn render_assistant_start(&self)
Render assistant message start.
Sourcepub fn clear_line(&self)
pub fn clear_line(&self)
Clear the current line (for progress updates).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PiConsole
impl !RefUnwindSafe for PiConsole
impl Send for PiConsole
impl Sync for PiConsole
impl Unpin for PiConsole
impl UnsafeUnpin for PiConsole
impl !UnwindSafe for PiConsole
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> 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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().