pub struct TuiTranscriptEntry {
pub role: String,
pub content: String,
pub tool_name: Option<ToolName>,
pub timestamp: Option<String>,
}Expand description
A single entry from a sub-agent’s JSONL transcript, ready for TUI display.
Loaded by the background transcript reader and converted to
ChatMessage for rendering in the chat widget via
to_chat_message.
§Examples
use zeph_tui::app::TuiTranscriptEntry;
let entry = TuiTranscriptEntry {
role: "assistant".to_string(),
content: "I found 3 results.".to_string(),
tool_name: None,
timestamp: None,
};
let msg = entry.to_chat_message();Fields§
§role: String§content: String§tool_name: Option<ToolName>§timestamp: Option<String>Implementations§
Source§impl TuiTranscriptEntry
impl TuiTranscriptEntry
Sourcepub fn to_chat_message(&self) -> ChatMessage
pub fn to_chat_message(&self) -> ChatMessage
Convert this transcript entry to a ChatMessage for chat widget rendering.
The role string is mapped to a MessageRole: "user", "assistant",
"tool", or "system" for all other values. The optional tool_name
and timestamp fields are forwarded verbatim.
§Examples
use zeph_tui::app::TuiTranscriptEntry;
use zeph_tui::MessageRole;
let entry = TuiTranscriptEntry {
role: "user".to_string(),
content: "hello".to_string(),
tool_name: None,
timestamp: Some("14:30".to_string()),
};
let msg = entry.to_chat_message();
assert_eq!(msg.role, MessageRole::User);
assert_eq!(msg.timestamp, "14:30");Trait Implementations§
Source§impl Clone for TuiTranscriptEntry
impl Clone for TuiTranscriptEntry
Source§fn clone(&self) -> TuiTranscriptEntry
fn clone(&self) -> TuiTranscriptEntry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TuiTranscriptEntry
impl RefUnwindSafe for TuiTranscriptEntry
impl Send for TuiTranscriptEntry
impl Sync for TuiTranscriptEntry
impl Unpin for TuiTranscriptEntry
impl UnsafeUnpin for TuiTranscriptEntry
impl UnwindSafe for TuiTranscriptEntry
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> 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: 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request