pub struct RecentTextTracker { /* private fields */ }Expand description
Tracks recently dictated text to provide continuity context.
When the user dictates multiple utterances in sequence, the earlier ones provide valuable context for the later ones. This tracker maintains a rolling window of recent transcription output.
Implementations§
Source§impl RecentTextTracker
impl RecentTextTracker
pub fn new() -> Self
Sourcepub fn get_recent_text(&self) -> Option<String>
pub fn get_recent_text(&self) -> Option<String>
Get the recent text as a single string (entries joined by spaces). Returns None if no recent text exists.
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Get the number of tracked entries.
Get a clone of the tracker that shares the same buffer. This is useful for sharing between the app loop and context providers.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RecentTextTracker
impl RefUnwindSafe for RecentTextTracker
impl Send for RecentTextTracker
impl Sync for RecentTextTracker
impl Unpin for RecentTextTracker
impl UnsafeUnpin for RecentTextTracker
impl UnwindSafe for RecentTextTracker
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