pub struct SessionHandle {
pub task_id: String,
pub session_id: Option<String>,
pub events: Receiver<StreamEvent>,
/* private fields */
}Expand description
Handle to a running headless session
Fields§
§task_id: StringTask ID this session is for
session_id: Option<String>Harness session ID (for continuation)
events: Receiver<StreamEvent>Event receiver
Implementations§
Source§impl SessionHandle
impl SessionHandle
Sourcepub fn from_child(
task_id: String,
child: Child,
events: Receiver<StreamEvent>,
) -> Self
pub fn from_child( task_id: String, child: Child, events: Receiver<StreamEvent>, ) -> Self
Create a SessionHandle backed by a child process
Sourcepub fn into_parts(self) -> (Receiver<StreamEvent>, SessionProcess)
pub fn into_parts(self) -> (Receiver<StreamEvent>, SessionProcess)
Decompose the session into its event receiver and a killable process handle.
This allows the caller to own the events stream and process separately, e.g. for bridging events to a different channel while retaining the ability to kill the subprocess on cancellation.
Auto Trait Implementations§
impl Freeze for SessionHandle
impl !RefUnwindSafe for SessionHandle
impl Send for SessionHandle
impl Sync for SessionHandle
impl Unpin for SessionHandle
impl UnsafeUnpin for SessionHandle
impl !UnwindSafe for SessionHandle
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