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: f64§stability_window_seconds: f64§sample_interval_seconds: f64§reset_on_input: bool§reset_on_output: bool§count_control_churn_as_output: bool§enabled: Arc<AtomicBool>§state: Mutex<IdleMonitorState>§condvar: CondvarImplementations§
Source§impl IdleDetectorCore
impl IdleDetectorCore
pub fn record_input(&self, byte_count: usize)
pub fn record_output(&self, data: &[u8])
pub fn mark_exit(&self, returncode: i32, interrupted: bool)
pub fn enabled(&self) -> bool
pub fn set_enabled(&self, enabled: bool)
pub fn wait(&self, timeout: Option<f64>) -> (bool, String, f64, Option<i32>)
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
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.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>
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