Struct std::sys::windows::pipe::AsyncPipe

source ·
struct AsyncPipe<'a> {
    pipe: Handle,
    event: Handle,
    overlapped: Box<OVERLAPPED>,
    dst: &'a mut Vec<u8>,
    state: State,
}

Fields§

§pipe: Handle§event: Handle§overlapped: Box<OVERLAPPED>§dst: &'a mut Vec<u8>§state: State

Implementations§

source§

impl<'a> AsyncPipe<'a>

source

fn new(pipe: Handle, dst: &'a mut Vec<u8>) -> Result<AsyncPipe<'a>>

source

fn schedule_read(&mut self) -> Result<bool>

Executes an overlapped read operation.

Must not currently be reading, and returns whether the pipe is currently at EOF or not. If the pipe is not at EOF then result() must be called to complete the read later on (may block), but if the pipe is at EOF then result() should not be called as it will just block forever.

source

fn result(&mut self) -> Result<bool>

Wait for the result of the overlapped operation previously executed.

Takes a parameter wait which indicates if this pipe is currently being read whether the function should block waiting for the read to complete.

Returns values:

  • true - finished any pending read and the pipe is not at EOF (keep going)
  • false - finished any pending read and pipe is at EOF (stop issuing reads)
source

fn finish(&mut self) -> Result<()>

Finishes out reading this pipe entirely.

Waits for any pending and schedule read, and then calls read_to_end if necessary to read all the remaining information.

Trait Implementations§

source§

impl<'a> Drop for AsyncPipe<'a>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for AsyncPipe<'a>

§

impl<'a> !Send for AsyncPipe<'a>

§

impl<'a> !Sync for AsyncPipe<'a>

§

impl<'a> Unpin for AsyncPipe<'a>

§

impl<'a> !UnwindSafe for AsyncPipe<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.