pub struct Receiver { /* private fields */ }Expand description
Receiving end of an Unix pipe.
Created by calling new or converted from ChildStdout or
ChildStderr.
Implementations
sourceimpl Receiver
impl Receiver
sourcepub fn from_child_stdout<M, RT>(
ctx: &mut Context<M, RT>,
stdout: ChildStdout
) -> Result<Receiver>where
RT: Access,
pub fn from_child_stdout<M, RT>(
ctx: &mut Context<M, RT>,
stdout: ChildStdout
) -> Result<Receiver>where
RT: Access,
Convert a ChildStdout to a Receiver.
sourcepub fn from_child_stderr<M, RT>(
ctx: &mut Context<M, RT>,
stderr: ChildStderr
) -> Result<Receiver>where
RT: Access,
pub fn from_child_stderr<M, RT>(
ctx: &mut Context<M, RT>,
stderr: ChildStderr
) -> Result<Receiver>where
RT: Access,
Convert a ChildStderr to a Receiver.
sourcepub fn try_read<B>(&mut self, buf: B) -> Result<usize>where
B: Bytes,
pub fn try_read<B>(&mut self, buf: B) -> Result<usize>where
B: Bytes,
Attempt to read bytes from the pipe, writing them into buf.
If no bytes can currently be read this will return an error with the
kind set to ErrorKind::WouldBlock. Most users should prefer to use
Receiver::read or Receiver::read_n.
sourcepub fn read<'a, B>(&'a mut self, buf: B) -> Read<'a, B>ⓘNotable traits for Read<'b, B>impl<'b, B> Future for Read<'b, B>where
B: Bytes + Unpin, type Output = Result<usize>;where
B: Bytes,
pub fn read<'a, B>(&'a mut self, buf: B) -> Read<'a, B>ⓘNotable traits for Read<'b, B>impl<'b, B> Future for Read<'b, B>where
B: Bytes + Unpin, type Output = Result<usize>;where
B: Bytes,
B: Bytes + Unpin, type Output = Result<usize>;
Read bytes from the pipe, writing them into buf.
sourcepub fn read_n<'a, B>(&'a mut self, buf: B, n: usize) -> ReadN<'a, B>ⓘNotable traits for ReadN<'b, B>impl<'b, B> Future for ReadN<'b, B>where
B: Bytes + Unpin, type Output = Result<()>;where
B: Bytes,
pub fn read_n<'a, B>(&'a mut self, buf: B, n: usize) -> ReadN<'a, B>ⓘNotable traits for ReadN<'b, B>impl<'b, B> Future for ReadN<'b, B>where
B: Bytes + Unpin, type Output = Result<()>;where
B: Bytes,
B: Bytes + Unpin, type Output = Result<()>;
Read at least n bytes from the pipe, writing them into buf.
This returns a Future that receives at least n bytes from the
Receiver and writes them into buffer B, or returns
io::ErrorKind::UnexpectedEof if less then n bytes could be read.
sourcepub fn try_read_vectored<B>(&mut self, bufs: B) -> Result<usize>where
B: BytesVectored,
pub fn try_read_vectored<B>(&mut self, bufs: B) -> Result<usize>where
B: BytesVectored,
Attempt to read bytes from the pipe, writing them into bufs.
If no bytes can currently be read this will return an error with the
kind set to ErrorKind::WouldBlock. Most users should prefer to use
Receiver::read_vectored or Receiver::read_n_vectored.
sourcepub fn read_vectored<B>(&mut self, bufs: B) -> ReadVectored<'_, B>ⓘNotable traits for ReadVectored<'b, B>impl<'b, B> Future for ReadVectored<'b, B>where
B: BytesVectored + Unpin, type Output = Result<usize>;where
B: BytesVectored,
pub fn read_vectored<B>(&mut self, bufs: B) -> ReadVectored<'_, B>ⓘNotable traits for ReadVectored<'b, B>impl<'b, B> Future for ReadVectored<'b, B>where
B: BytesVectored + Unpin, type Output = Result<usize>;where
B: BytesVectored,
B: BytesVectored + Unpin, type Output = Result<usize>;
Read bytes from the pipe, writing them into bufs.
sourcepub fn read_n_vectored<B>(&mut self, bufs: B, n: usize) -> ReadNVectored<'_, B>ⓘNotable traits for ReadNVectored<'b, B>impl<'b, B> Future for ReadNVectored<'b, B>where
B: BytesVectored + Unpin, type Output = Result<()>;where
B: BytesVectored,
pub fn read_n_vectored<B>(&mut self, bufs: B, n: usize) -> ReadNVectored<'_, B>ⓘNotable traits for ReadNVectored<'b, B>impl<'b, B> Future for ReadNVectored<'b, B>where
B: BytesVectored + Unpin, type Output = Result<()>;where
B: BytesVectored,
B: BytesVectored + Unpin, type Output = Result<()>;
Read at least n bytes from the pipe, writing them into bufs.