pub struct NativePtyProcess {Show 19 fields
pub argv: Vec<String>,
pub cwd: Option<String>,
pub env: Option<Vec<(String, String)>>,
pub rows: u16,
pub cols: u16,
pub handles: Arc<Mutex<Option<NativePtyHandles>>>,
pub reader: Arc<PtyReadShared>,
pub returncode: Arc<Mutex<Option<i32>>>,
pub input_bytes_total: Arc<AtomicUsize>,
pub newline_events_total: Arc<AtomicUsize>,
pub submit_events_total: Arc<AtomicUsize>,
pub echo: Arc<AtomicBool>,
pub idle_detector: Arc<Mutex<Option<Arc<IdleDetectorCore>>>>,
pub output_bytes_total: Arc<AtomicUsize>,
pub control_churn_bytes_total: Arc<AtomicUsize>,
pub reader_worker: Mutex<Option<JoinHandle<()>>>,
pub terminal_input_relay_stop: Arc<AtomicBool>,
pub terminal_input_relay_active: Arc<AtomicBool>,
pub terminal_input_relay_worker: Mutex<Option<JoinHandle<()>>>,
}Fields§
§argv: Vec<String>§cwd: Option<String>§env: Option<Vec<(String, String)>>§rows: u16§cols: u16§handles: Arc<Mutex<Option<NativePtyHandles>>>§reader: Arc<PtyReadShared>§returncode: Arc<Mutex<Option<i32>>>§input_bytes_total: Arc<AtomicUsize>§newline_events_total: Arc<AtomicUsize>§submit_events_total: Arc<AtomicUsize>§echo: Arc<AtomicBool>When true, the reader thread writes PTY output to stdout.
idle_detector: Arc<Mutex<Option<Arc<IdleDetectorCore>>>>When set, the reader thread feeds output directly to the idle detector.
output_bytes_total: Arc<AtomicUsize>Visible (non-control) output bytes seen by the reader thread.
control_churn_bytes_total: Arc<AtomicUsize>Control churn bytes (ANSI escapes, BS, CR, DEL) seen by the reader.
reader_worker: Mutex<Option<JoinHandle<()>>>§terminal_input_relay_stop: Arc<AtomicBool>§terminal_input_relay_active: Arc<AtomicBool>§terminal_input_relay_worker: Mutex<Option<JoinHandle<()>>>Implementations§
Source§impl NativePtyProcess
impl NativePtyProcess
pub fn new( argv: Vec<String>, cwd: Option<String>, env: Option<Vec<(String, String)>>, rows: u16, cols: u16, nice: Option<i32>, ) -> Result<Self, PtyError>
pub fn mark_reader_closed(&self)
pub fn store_returncode(&self, code: i32)
pub fn record_input_metrics(&self, data: &[u8], submit: bool)
pub fn write_impl(&self, data: &[u8], submit: bool) -> Result<(), PtyError>
pub fn request_terminal_input_relay_stop(&self)
pub fn start_terminal_input_relay_impl(&self) -> Result<(), PtyError>
pub fn stop_terminal_input_relay_impl(&self)
pub fn terminal_input_relay_active(&self) -> bool
Sourcepub fn close_impl(&self) -> Result<(), PtyError>
pub fn close_impl(&self) -> Result<(), PtyError>
Synchronously tear down the PTY and reap the child.
Sourcepub fn close_nonblocking(&self)
pub fn close_nonblocking(&self)
Best-effort, non-blocking teardown for use from Drop.
pub fn start_impl(&self) -> Result<(), PtyError>
pub fn respond_to_queries_impl(&self, data: &[u8]) -> Result<(), PtyError>
pub fn resize_impl(&self, rows: u16, cols: u16) -> Result<(), PtyError>
pub fn send_interrupt_impl(&self) -> Result<(), PtyError>
pub fn wait_impl(&self, timeout: Option<f64>) -> Result<i32, PtyError>
pub fn terminate_impl(&self) -> Result<(), PtyError>
pub fn kill_impl(&self) -> Result<(), PtyError>
pub fn terminate_tree_impl(&self) -> Result<(), PtyError>
pub fn kill_tree_impl(&self) -> Result<(), PtyError>
Sourcepub fn pid(&self) -> Result<Option<u32>, PtyError>
pub fn pid(&self) -> Result<Option<u32>, PtyError>
Get the PID of the child process, if running.
Sourcepub fn read_chunk_impl(
&self,
timeout: Option<f64>,
) -> Result<Option<Vec<u8>>, PtyError>
pub fn read_chunk_impl( &self, timeout: Option<f64>, ) -> Result<Option<Vec<u8>>, PtyError>
Wait for a chunk of output from the PTY reader.
Returns Ok(Some(chunk)) on data, Ok(None) on timeout, Err on closed.
Sourcepub fn wait_for_reader_closed_impl(&self, timeout: Option<f64>) -> bool
pub fn wait_for_reader_closed_impl(&self, timeout: Option<f64>) -> bool
Wait for the reader thread to close.
Sourcepub fn wait_and_drain_impl(
&self,
timeout: Option<f64>,
drain_timeout: f64,
) -> Result<i32, PtyError>
pub fn wait_and_drain_impl( &self, timeout: Option<f64>, drain_timeout: f64, ) -> Result<i32, PtyError>
Wait for exit then drain remaining output.
pub fn set_echo(&self, enabled: bool)
pub fn echo_enabled(&self) -> bool
pub fn attach_idle_detector(&self, detector: &Arc<IdleDetectorCore>)
pub fn detach_idle_detector(&self)
pub fn pty_input_bytes_total(&self) -> usize
pub fn pty_newline_events_total(&self) -> usize
pub fn pty_submit_events_total(&self) -> usize
pub fn pty_output_bytes_total(&self) -> usize
pub fn pty_control_churn_bytes_total(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for NativePtyProcess
impl RefUnwindSafe for NativePtyProcess
impl Send for NativePtyProcess
impl Sync for NativePtyProcess
impl Unpin for NativePtyProcess
impl UnsafeUnpin for NativePtyProcess
impl UnwindSafe for NativePtyProcess
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