Struct TranscriptWindow
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§
§impl TranscriptWindow
impl TranscriptWindow
pub fn new(turns: Vec<TranscriptTurn>) -> TranscriptWindow
pub fn new(turns: Vec<TranscriptTurn>) -> TranscriptWindow
Create a window from a vec of turns.
pub fn turns(&self) -> &[TranscriptTurn]
pub fn turns(&self) -> &[TranscriptTurn]
The turns in this window.
pub fn last_model(&self) -> Option<&str>
pub fn last_model(&self) -> Option<&str>
Last model utterance, if any.
Trait Implementations§
§impl Clone for TranscriptWindow
impl Clone for TranscriptWindow
§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 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