pub struct StreamStore { /* private fields */ }Expand description
Thread-safe store for multiple agent sessions
Implementations§
Source§impl StreamStore
impl StreamStore
pub fn new() -> Self
Sourcepub fn create_session(&self, task_id: &str, tag: &str) -> String
pub fn create_session(&self, task_id: &str, tag: &str) -> String
Create a new session for a task
Sourcepub fn push_event(&self, task_id: &str, event: StreamEvent)
pub fn push_event(&self, task_id: &str, event: StreamEvent)
Push an event to a session
Sourcepub fn set_session_id(&self, task_id: &str, session_id: &str)
pub fn set_session_id(&self, task_id: &str, session_id: &str)
Set the harness session ID for a task
Sourcepub fn get_output(&self, task_id: &str, limit: usize) -> Vec<String>
pub fn get_output(&self, task_id: &str, limit: usize) -> Vec<String>
Get output lines for a task
Sourcepub fn get_all_output(&self, task_id: &str) -> Vec<String>
pub fn get_all_output(&self, task_id: &str) -> Vec<String>
Get all output lines for a task, including any partial line
Sourcepub fn get_status(&self, task_id: &str) -> Option<SessionStatus>
pub fn get_status(&self, task_id: &str) -> Option<SessionStatus>
Get session status
Sourcepub fn get_session_id(&self, task_id: &str) -> Option<String>
pub fn get_session_id(&self, task_id: &str) -> Option<String>
Get harness session ID for continuation
Sourcepub fn active_tasks(&self) -> Vec<String>
pub fn active_tasks(&self) -> Vec<String>
List all active task IDs
Sourcepub fn has_session(&self, task_id: &str) -> bool
pub fn has_session(&self, task_id: &str) -> bool
Check if a session exists
Sourcepub fn remove_session(&self, task_id: &str) -> Option<SessionStream>
pub fn remove_session(&self, task_id: &str) -> Option<SessionStream>
Remove a session
Trait Implementations§
Source§impl Clone for StreamStore
impl Clone for StreamStore
Source§fn clone(&self) -> StreamStore
fn clone(&self) -> StreamStore
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 moreSource§impl Debug for StreamStore
impl Debug for StreamStore
Source§impl Default for StreamStore
impl Default for StreamStore
Source§fn default() -> StreamStore
fn default() -> StreamStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StreamStore
impl RefUnwindSafe for StreamStore
impl Send for StreamStore
impl Sync for StreamStore
impl Unpin for StreamStore
impl UnwindSafe for StreamStore
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 more