pub struct PtySpawner { /* private fields */ }Expand description
Spawner for PTY sessions.
Implementations§
Source§impl PtySpawner
impl PtySpawner
Sourcepub const fn with_config(config: PtyConfig) -> Self
pub const fn with_config(config: PtyConfig) -> Self
Create a new PTY spawner with custom configuration.
Sourcepub const fn set_dimensions(&mut self, cols: u16, rows: u16)
pub const fn set_dimensions(&mut self, cols: u16, rows: u16)
Set the terminal dimensions.
Sourcepub async fn spawn(&self, command: &str, args: &[String]) -> Result<PtyHandle>
pub async fn spawn(&self, command: &str, args: &[String]) -> Result<PtyHandle>
Spawn a command.
The Unix implementation spawns via tokio::process::Command (through
rust-pty’s UnixPtySystem); the only work between fork and exec is the
async-signal-safe setsid + TIOCSCTTY in rust-pty’s pre_exec hook,
so it is safe under a multi-threaded Tokio runtime (the default
#[tokio::main]). Environment and working-directory setup happen in the
parent before spawning.
§Errors
Returns an error if PTY allocation or process spawning fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PtySpawner
impl RefUnwindSafe for PtySpawner
impl Send for PtySpawner
impl Sync for PtySpawner
impl Unpin for PtySpawner
impl UnsafeUnpin for PtySpawner
impl UnwindSafe for PtySpawner
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