pub struct PtyManager { /* private fields */ }Implementations§
Source§impl PtyManager
impl PtyManager
pub fn new() -> Self
pub fn with_signal_handler(on_signal: SignalHandler) -> Self
pub fn create_pty(&self) -> PtyPair
pub fn create_pty_fds( &self, fd_table: &mut ProcessFdTable, ) -> FdResult<(u32, u32, String)>
pub fn poll( &self, description_id: u64, requested: PollEvents, ) -> PtyResult<PollEvents>
pub fn write( &self, description_id: u64, data: impl AsRef<[u8]>, ) -> PtyResult<usize>
pub fn read( &self, description_id: u64, length: usize, ) -> PtyResult<Option<Vec<u8>>>
pub fn read_with_timeout( &self, description_id: u64, length: usize, timeout: Option<Duration>, ) -> PtyResult<Option<Vec<u8>>>
pub fn close(&self, description_id: u64)
pub fn is_pty(&self, description_id: u64) -> bool
pub fn is_slave(&self, description_id: u64) -> bool
pub fn set_discipline( &self, description_id: u64, config: LineDisciplineConfig, ) -> PtyResult<()>
Sourcepub fn set_raw_mode(
&self,
description_id: u64,
lease_owner_pid: Option<u32>,
enabled: bool,
) -> PtyResult<Option<u64>>
pub fn set_raw_mode( &self, description_id: u64, lease_owner_pid: Option<u32>, enabled: bool, ) -> PtyResult<Option<u64>>
Apply or release raw mode for a process. A foreground owner receives a generation-scoped lease so teardown can recover the exact attributes it inherited without letting an unrelated child restore a stale snapshot.
lease_owner_pid = None applies the requested mode but deliberately
does not register teardown recovery (used for a background process).
Sourcepub fn release_raw_mode(
&self,
description_id: u64,
owner_pid: u32,
generation: u64,
) -> PtyResult<bool>
pub fn release_raw_mode( &self, description_id: u64, owner_pid: u32, generation: u64, ) -> PtyResult<bool>
Release a particular foreground raw-mode lease during process cleanup. Returns whether the lease still existed. A stale/non-top release never changes live terminal attributes; its restore point is transferred to the next owner so out-of-order child exits still unwind correctly.
pub fn get_termios(&self, description_id: u64) -> PtyResult<Termios>
pub fn set_termios( &self, description_id: u64, termios: PartialTermios, ) -> PtyResult<()>
pub fn set_foreground_pgid( &self, description_id: u64, pgid: u32, ) -> PtyResult<()>
pub fn get_foreground_pgid(&self, description_id: u64) -> PtyResult<u32>
pub fn window_size(&self, description_id: u64) -> PtyResult<PtyWindowSize>
pub fn resize( &self, description_id: u64, cols: u16, rows: u16, ) -> PtyResult<Option<u32>>
pub fn pty_count(&self) -> usize
pub fn buffered_input_bytes(&self) -> usize
pub fn buffered_output_bytes(&self) -> usize
pub fn pending_read_waiter_count(&self) -> usize
pub fn queued_read_waiter_count(&self) -> usize
pub fn path_for(&self, description_id: u64) -> Option<String>
Trait Implementations§
Source§impl Clone for PtyManager
impl Clone for PtyManager
Source§fn clone(&self) -> PtyManager
fn clone(&self) -> PtyManager
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PtyManager
impl !UnwindSafe for PtyManager
impl Freeze for PtyManager
impl Send for PtyManager
impl Sync for PtyManager
impl Unpin for PtyManager
impl UnsafeUnpin for PtyManager
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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