pub struct SessionTranscript { /* private fields */ }Expand description
Ordered transcript view assembled from persisted session messages.
Implementations§
Source§impl SessionTranscript
impl SessionTranscript
Sourcepub fn new(messages: Vec<SessionMessage>) -> Self
pub fn new(messages: Vec<SessionMessage>) -> Self
Creates an ordered transcript from persisted messages.
Sourcepub fn messages(&self) -> &[SessionMessage]
pub fn messages(&self) -> &[SessionMessage]
Returns the ordered transcript messages.
Sourcepub fn content_hash(&self) -> u64
pub fn content_hash(&self) -> u64
Returns the cached content identity for render and projection caches.
Sourcepub fn total_content_len(&self) -> usize
pub fn total_content_len(&self) -> usize
Returns the total byte length of message content in this transcript.
Sourcepub fn append_message(&mut self, kind: SessionMessageKind, content: &str)
pub fn append_message(&mut self, kind: SessionMessageKind, content: &str)
Appends one message after the ordered transcript tail using the same content normalization as durable storage.
Self::new sorts persisted input before this method derives the next
position, so the message slice and its cached content hash retain the
same ordering as a newly reconstructed transcript.
Sourcepub fn replay_text(&self) -> Option<String>
pub fn replay_text(&self) -> Option<String>
Returns formatted transcript text for replay when content exists.
User and assistant rows store raw content, so replay injects the prompt marker and transcript spacing only for display and provider replay.
Sourcepub fn conversation_replay_text(&self) -> Option<String>
pub fn conversation_replay_text(&self) -> Option<String>
Returns formatted user and assistant transcript text when any conversation messages exist.
Sourcepub fn display_text_for_messages(messages: &[SessionMessage]) -> String
pub fn display_text_for_messages(messages: &[SessionMessage]) -> String
Formats an ordered message slice using canonical transcript display markers and spacing.
Unlike Self::new, this method preserves the caller-provided order.
It is useful when rendering a selected subset of an existing transcript
without constructing another transcript aggregate.
Trait Implementations§
Source§impl Clone for SessionTranscript
impl Clone for SessionTranscript
Source§fn clone(&self) -> SessionTranscript
fn clone(&self) -> SessionTranscript
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionTranscript
impl Debug for SessionTranscript
Source§impl Default for SessionTranscript
impl Default for SessionTranscript
Source§fn default() -> SessionTranscript
fn default() -> SessionTranscript
impl Eq for SessionTranscript
Source§impl PartialEq for SessionTranscript
impl PartialEq for SessionTranscript
impl StructuralPartialEq for SessionTranscript
Auto Trait Implementations§
impl Freeze for SessionTranscript
impl RefUnwindSafe for SessionTranscript
impl Send for SessionTranscript
impl Sync for SessionTranscript
impl Unpin for SessionTranscript
impl UnsafeUnpin for SessionTranscript
impl UnwindSafe for SessionTranscript
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.