pub struct SessionWatcher {
pub pane_id: String,
pub member_name: String,
pub state: WatcherState,
/* private fields */
}Fields§
§pane_id: String§member_name: String§state: WatcherStateImplementations§
Source§impl SessionWatcher
impl SessionWatcher
pub fn new( pane_id: &str, member_name: &str, _stale_secs: u64, tracker: Option<SessionTrackerConfig>, ) -> Self
Sourcepub fn poll(&mut self) -> Result<WatcherState>
pub fn poll(&mut self) -> Result<WatcherState>
Poll the pane and update state.
Sourcepub fn is_ready_for_delivery(&self) -> bool
pub fn is_ready_for_delivery(&self) -> bool
Whether this agent’s pane has been confirmed ready for message delivery.
Returns true once the agent prompt has been observed at least once since
the watcher was created or last activated. This prevents injecting messages
into panes where the agent CLI hasn’t finished starting.
Sourcepub fn confirm_ready(&mut self)
pub fn confirm_ready(&mut self)
Externally confirm that the agent pane is ready (e.g. from a delivery readiness check that observed the prompt). Updates state to Ready if it was still in the initial Idle state before first readiness confirmation.
pub fn set_session_id(&mut self, session_id: Option<String>)
Sourcepub fn deactivate(&mut self)
pub fn deactivate(&mut self)
Mark this watcher as idle.
Sourcepub fn secs_since_last_output_change(&self) -> u64
pub fn secs_since_last_output_change(&self) -> u64
Seconds since the last time pane output changed.
Sourcepub fn last_output(&self) -> &str
pub fn last_output(&self) -> &str
Get the last captured pane output.
Sourcepub fn last_lines(&self, n: usize) -> String
pub fn last_lines(&self, n: usize) -> String
Get the last N lines of captured output.
pub fn current_session_id(&self) -> Option<String>
pub fn configured_session_id(&self) -> Option<String>
pub fn current_session_size_bytes(&self) -> Option<u64>
pub fn codex_quality_signals(&self) -> Option<CodexQualitySignals>
pub fn take_completion_event(&mut self) -> bool
pub fn refresh_session_tracking(&mut self) -> Result<()>
Auto Trait Implementations§
impl Freeze for SessionWatcher
impl RefUnwindSafe for SessionWatcher
impl Send for SessionWatcher
impl Sync for SessionWatcher
impl Unpin for SessionWatcher
impl UnsafeUnpin for SessionWatcher
impl UnwindSafe for SessionWatcher
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.