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>
impl<'a> AsyncPipe<'a>
fn new(pipe: Handle, dst: &'a mut Vec<u8>) -> Result<AsyncPipe<'a>>
sourcefn schedule_read(&mut self) -> Result<bool>
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.
sourcefn result(&mut self) -> Result<bool>
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)
Trait Implementations§
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> 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