[][src]Struct tokio_pty_process_stream::Process

pub struct Process<R: AsyncRead> { /* fields omitted */ }

A spawned process.

Wraps AsyncPtyMaster and Child from tokio-pty-process to provide a view of the process as a single stream which emits events. In particular, the stream will return an event when the process starts, when it writes output to the pty, and when it exits. See the Event type for more details.

Methods

impl<R: AsyncRead + 'static> Process<R>[src]

pub fn new(cmd: &str, args: &[String], input: R) -> Self[src]

Creates a new process stream.

The process is not spawned and the pty is not opened until poll is called.

Takes as input the command and arguments to run, as well as the AsyncRead object to read input from. Typically you will pass in something connected to stdin here, although other options may be more useful for automation or testing.

pub fn resize(&mut self, rows: u16, cols: u16)[src]

Requests a change to the pty's terminal size.

This will only be applied on the next call to poll.

pub fn input(&mut self) -> &mut R[src]

Returns a mutable reference to the input object provided in the constructor.

This can be useful if you are driving the input manually, rather than just hooking it up directly to stdin.

Trait Implementations

impl<R: AsyncRead + 'static> Stream for Process<R>[src]

type Item = Event

The type of item this stream will yield on success.

type Error = Error

The type of error this stream may generate.

Auto Trait Implementations

impl<R> Send for Process<R> where
    R: Send

impl<R> !Sync for Process<R>

impl<R> Unpin for Process<R> where
    R: Unpin

impl<R> !UnwindSafe for Process<R>

impl<R> !RefUnwindSafe for Process<R>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<St> StreamExt for St where
    St: Stream
[src]

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]