ReadWriteResult

Enum ReadWriteResult 

enum ReadWriteResult {
    Success {
        remainder: Vec<u8>,
        key_event_records: Vec<KEY_EVENT_RECORD>,
    },
    WouldBlock,
    Err,
    Disconnect,
}
Expand description

Possible results when reading from the named pipe and writing to the current process’s stdinput.

Variants§

§

Success

We wrote all complete [INPUT_RECORD_0] sequences we read from the named pipe to stdin.

Fields

§remainder: Vec<u8>

Incomplete [INPUT_RECORD_0] sequence.

What we read from the named pipe is a serialized [INPUT_RECORD_0].KeyEvent. As this is simply a SERIALIZED_INPUT_RECORD_0_LENGTH byte long sequence and we try to read from the pipe until we have some of the data it can happen that during any one read/write iteration we don’t read the full sequence so we must keep track of what we read for next iterations where we will be able to read the remainder of the sequence.

§key_event_records: Vec<KEY_EVENT_RECORD>

List of [KEY_EVENT_RECORD]s we have read from the named pipe.

Used to detect the Alt + Shift + C key combination used to close the console window after the client process encountered an unexpected error.

§

WouldBlock

Trying to read from the pipe would require us to wait for data.

§

Err

Something went wrong.

§

Disconnect

The pipe was closed.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.