pub trait OutputFormatter: Serialize + JsonSchema {
// Required method
fn format_text(&self) -> String;
// Provided method
fn format_pretty(&self) -> String { ... }
}Expand description
Trait for types that can format output in multiple formats.
Types implementing this trait provide text formatting. JSON/jq/jsonl
output is handled automatically by server-less via Serialize.
Required Methods§
Sourcefn format_text(&self) -> String
fn format_text(&self) -> String
Format as minimal text (LLM-optimized, default).
Provided Methods§
Sourcefn format_pretty(&self) -> String
fn format_pretty(&self) -> String
Format as pretty text (human-friendly with colors). Default implementation falls back to format_text().
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.