pub struct IdleDetectorCore {
pub timeout_seconds: f64,
pub stability_window_seconds: f64,
pub sample_interval_seconds: f64,
pub reset_on_input: bool,
pub reset_on_output: bool,
pub count_control_churn_as_output: bool,
pub enabled: Arc<AtomicBool>,
pub state: Mutex<IdleMonitorState>,
pub condvar: Condvar,
}Expand description
Core idle detection logic, shareable across threads via Arc.
The reader thread calls record_output directly.
Fields§
§timeout_seconds: f64Minimum idle duration before the detector reports an idle timeout.
stability_window_seconds: f64Additional quiet window required before reporting idle.
sample_interval_seconds: f64Poll interval used while waiting for idle or exit.
reset_on_input: boolWhether PTY input resets the idle timer.
reset_on_output: boolWhether PTY output resets the idle timer.
count_control_churn_as_output: boolWhether ANSI/control churn without visible bytes counts as output.
enabled: Arc<AtomicBool>Runtime switch that enables or disables idle timeout detection.
state: Mutex<IdleMonitorState>Protected idle timing and exit state.
condvar: CondvarNotifies idle waiters when activity, exit, or enablement changes.
Implementations§
Source§impl IdleDetectorCore
impl IdleDetectorCore
Sourcepub fn record_input(&self, byte_count: usize)
pub fn record_input(&self, byte_count: usize)
Record input activity and reset the idle timer when configured.
Sourcepub fn record_output(&self, data: &[u8])
pub fn record_output(&self, data: &[u8])
Record output activity and reset the idle timer when configured.
Sourcepub fn mark_exit(&self, returncode: i32, interrupted: bool)
pub fn mark_exit(&self, returncode: i32, interrupted: bool)
Record child process exit information and wake idle waiters.
Sourcepub fn set_enabled(&self, enabled: bool)
pub fn set_enabled(&self, enabled: bool)
Enable or disable idle timeout detection.
Auto Trait Implementations§
impl !Freeze for IdleDetectorCore
impl RefUnwindSafe for IdleDetectorCore
impl Send for IdleDetectorCore
impl Sync for IdleDetectorCore
impl Unpin for IdleDetectorCore
impl UnsafeUnpin for IdleDetectorCore
impl UnwindSafe for IdleDetectorCore
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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