pub struct TranscriptFormatter;Expand description
Formats bounded TranscriptEntry slices into role-prefixed, tool-collapsed text.
Implementations§
Source§impl TranscriptFormatter
impl TranscriptFormatter
Sourcepub fn render_flat(entries: &[TranscriptEntry]) -> String
pub fn render_flat(entries: &[TranscriptEntry]) -> String
Render entries as a single newline-joined, role-prefixed string.
Used by every channel that has no structured display buffer of its own (CLI, Telegram,
Discord, Slack). The TUI backfill path instead pushes each entry individually into its
own chat message buffer, but still sources entries from the same
MessageAccess::transcript_page bounded slice.
§Examples
use zeph_commands::transcript::{TranscriptEntry, TranscriptFormatter, TranscriptRole};
let entries = vec![TranscriptEntry {
role: TranscriptRole::User,
content: "hello".to_owned(),
tool_name: None,
}];
let text = TranscriptFormatter::render_flat(&entries);
assert_eq!(text, "user: hello");Sourcepub fn render_line(entry: &TranscriptEntry) -> String
pub fn render_line(entry: &TranscriptEntry) -> String
Render a single entry as one role-prefixed, tool-collapsed line.
Auto Trait Implementations§
impl Freeze for TranscriptFormatter
impl RefUnwindSafe for TranscriptFormatter
impl Send for TranscriptFormatter
impl Sync for TranscriptFormatter
impl Unpin for TranscriptFormatter
impl UnsafeUnpin for TranscriptFormatter
impl UnwindSafe for TranscriptFormatter
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