pub struct TranscriptWindow { /* private fields */ }Expand description
A read-only snapshot of recent transcript turns for context construction.
Cheap to create (clone of ~5 small structs). Used by on_enter_context
callbacks to reference recent conversation without holding the buffer lock.
Implementations§
Source§impl TranscriptWindow
impl TranscriptWindow
Sourcepub fn new(turns: Vec<TranscriptTurn>) -> Self
pub fn new(turns: Vec<TranscriptTurn>) -> Self
Create a window from a vec of turns.
Sourcepub fn turns(&self) -> &[TranscriptTurn]
pub fn turns(&self) -> &[TranscriptTurn]
The turns in this window.
Sourcepub fn last_model(&self) -> Option<&str>
pub fn last_model(&self) -> Option<&str>
Last model utterance, if any.
Trait Implementations§
Source§impl Clone for TranscriptWindow
impl Clone for TranscriptWindow
Source§fn clone(&self) -> TranscriptWindow
fn clone(&self) -> TranscriptWindow
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 TranscriptWindow
impl RefUnwindSafe for TranscriptWindow
impl Send for TranscriptWindow
impl Sync for TranscriptWindow
impl Unpin for TranscriptWindow
impl UnsafeUnpin for TranscriptWindow
impl UnwindSafe for TranscriptWindow
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