pub struct FastMcpConsole { /* private fields */ }Expand description
FastMCP console for rich output to stderr.
This type centralizes rich-vs-plain output behavior and exposes convenience methods for printing tables, panels, and styled text.
§Example
ⓘ
use fastmcp_console::console::FastMcpConsole;
use rich_rust::prelude::Style;
let console = FastMcpConsole::new();
console.print_styled("Server started", Style::new().bold());Implementations§
Source§impl FastMcpConsole
impl FastMcpConsole
Sourcepub fn with_enabled(enabled: bool) -> Self
pub fn with_enabled(enabled: bool) -> Self
Create with explicit enable/disable
Sourcepub fn with_writer<W: Write + Send + 'static>(writer: W, enabled: bool) -> Self
pub fn with_writer<W: Write + Send + 'static>(writer: W, enabled: bool) -> Self
Create with custom writer (for testing)
Sourcepub fn theme(&self) -> &FastMcpTheme
pub fn theme(&self) -> &FastMcpTheme
Get the theme used for standard styling.
Sourcepub fn print_plain(&self, text: &str)
pub fn print_plain(&self, text: &str)
Print plain text (no markup processing ever).
Sourcepub fn render<R: Renderable>(&self, renderable: &R)
pub fn render<R: Renderable>(&self, renderable: &R)
Print a renderable.
Sourcepub fn render_or<F>(&self, render_op: F, plain_fallback: &str)
pub fn render_or<F>(&self, render_op: F, plain_fallback: &str)
Print a renderable with plain-text fallback closure.
Sourcepub fn print_styled(&self, text: &str, style: Style)
pub fn print_styled(&self, text: &str, style: Style)
Print styled text with a specific style.
Sourcepub fn print_table(&self, table: &Table, plain_fallback: &str)
pub fn print_table(&self, table: &Table, plain_fallback: &str)
Print a table (with plain fallback).
Sourcepub fn print_panel(&self, panel: &Panel<'_>, plain_fallback: &str)
pub fn print_panel(&self, panel: &Panel<'_>, plain_fallback: &str)
Print a panel (with plain fallback).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FastMcpConsole
impl RefUnwindSafe for FastMcpConsole
impl Send for FastMcpConsole
impl Sync for FastMcpConsole
impl Unpin for FastMcpConsole
impl UnwindSafe for FastMcpConsole
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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).