pub struct SessionStream {
pub session_id: String,
pub task_id: String,
pub tag: String,
pub events: Vec<StreamEvent>,
pub output_lines: Vec<String>,
pub status: SessionStatus,
pub started_at: Instant,
pub pid: Option<u32>,
/* private fields */
}Expand description
Stream data for a single agent session
Fields§
§session_id: StringUnique session ID (from harness)
task_id: StringAssociated task ID
tag: StringTag/phase
events: Vec<StreamEvent>All events received (bounded by MAX_EVENTS)
output_lines: Vec<String>Rendered output lines for display (bounded by MAX_OUTPUT_LINES)
status: SessionStatusCurrent status
started_at: InstantWhen the session started
pid: Option<u32>Process ID (for interruption)
Implementations§
Source§impl SessionStream
impl SessionStream
pub fn new(task_id: &str, tag: &str) -> Self
Sourcepub fn push_event(&mut self, event: StreamEvent)
pub fn push_event(&mut self, event: StreamEvent)
Add an event and update output lines
Sourcepub fn get_all_output(&self) -> Vec<String>
pub fn get_all_output(&self) -> Vec<String>
Get all output lines including any partial line in progress
Sourcepub fn event_count(&self) -> usize
pub fn event_count(&self) -> usize
Get the event count
Sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
Get the output line count
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionStream
impl RefUnwindSafe for SessionStream
impl Send for SessionStream
impl Sync for SessionStream
impl Unpin for SessionStream
impl UnwindSafe for SessionStream
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> 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