pub struct Sender { /* private fields */ }Expand description
Sending end of an Unix pipe.
Created by calling new or converted from ChildStdin.
Implementations
sourceimpl Sender
impl Sender
sourcepub fn from_child_stdin<M, RT>(
ctx: &mut Context<M, RT>,
stdin: ChildStdin
) -> Result<Sender>where
RT: Access,
pub fn from_child_stdin<M, RT>(
ctx: &mut Context<M, RT>,
stdin: ChildStdin
) -> Result<Sender>where
RT: Access,
Convert a ChildStdin to a Sender.
sourcepub fn try_write(&mut self, buf: &[u8]) -> Result<usize>
pub fn try_write(&mut self, buf: &[u8]) -> Result<usize>
Attempt to write the bytes in buf into the pipe.
If no bytes can currently be written this will return an error with the
kind set to ErrorKind::WouldBlock. Most users should prefer to use
Sender::write or Sender::write_all.
sourcepub fn write<'a, 'b>(&'a mut self, buf: &'b [u8]) -> Write<'a, 'b>ⓘNotable traits for Write<'a, 'b>impl<'a, 'b> Future for Write<'a, 'b> type Output = Result<usize>;
pub fn write<'a, 'b>(&'a mut self, buf: &'b [u8]) -> Write<'a, 'b>ⓘNotable traits for Write<'a, 'b>impl<'a, 'b> Future for Write<'a, 'b> type Output = Result<usize>;
Write the bytes in buf into the pipe.
Return the number of bytes written. This may we fewer then the length of
buf. To ensure that all bytes are written use Sender::write_all.
sourcepub fn write_all<'a, 'b>(&'a mut self, buf: &'b [u8]) -> WriteAll<'a, 'b>ⓘNotable traits for WriteAll<'a, 'b>impl<'a, 'b> Future for WriteAll<'a, 'b> type Output = Result<()>;
pub fn write_all<'a, 'b>(&'a mut self, buf: &'b [u8]) -> WriteAll<'a, 'b>ⓘNotable traits for WriteAll<'a, 'b>impl<'a, 'b> Future for WriteAll<'a, 'b> type Output = Result<()>;
Write the all bytes in buf into the pipe.
If this fails to write all bytes (this happens if a write returns
Ok(0)) this will return io::ErrorKind::WriteZero.
sourcepub fn try_write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize>
pub fn try_write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize>
Attempt to write the bytes in bufs into the pipe.
If no bytes can currently be written this will return an error with the
kind set to ErrorKind::WouldBlock. Most users should prefer to use
Sender::write_vectored or Sender::write_vectored_all.
sourcepub fn write_vectored<'a, 'b>(
&'a mut self,
bufs: &'b mut [IoSlice<'b>]
) -> WriteVectored<'a, 'b>ⓘNotable traits for WriteVectored<'a, 'b>impl<'a, 'b> Future for WriteVectored<'a, 'b> type Output = Result<usize>;
pub fn write_vectored<'a, 'b>(
&'a mut self,
bufs: &'b mut [IoSlice<'b>]
) -> WriteVectored<'a, 'b>ⓘNotable traits for WriteVectored<'a, 'b>impl<'a, 'b> Future for WriteVectored<'a, 'b> type Output = Result<usize>;
Write the bytes in bufs intoto the pipe.
Return the number of bytes written. This may we fewer then the length of
bufs. To ensure that all bytes are written use
Sender::write_vectored_all.
sourcepub fn write_vectored_all<'a, 'b>(
&'a mut self,
bufs: &'b mut [IoSlice<'b>]
) -> WriteVectoredAll<'a, 'b>ⓘNotable traits for WriteVectoredAll<'a, 'b>impl<'a, 'b> Future for WriteVectoredAll<'a, 'b> type Output = Result<()>;
pub fn write_vectored_all<'a, 'b>(
&'a mut self,
bufs: &'b mut [IoSlice<'b>]
) -> WriteVectoredAll<'a, 'b>ⓘNotable traits for WriteVectoredAll<'a, 'b>impl<'a, 'b> Future for WriteVectoredAll<'a, 'b> type Output = Result<()>;
Write the all bytes in bufs into the pipe.
If this fails to write all bytes (this happens if a write returns
Ok(0)) this will return io::ErrorKind::WriteZero.