pub struct MessageWriteHalf<'a, M: RingMem> { /* private fields */ }
Expand description
The write half of a pipe.
Implementations§
Source§impl<M: RingMem> MessageWriteHalf<'_, M>
impl<M: RingMem> MessageWriteHalf<'_, M>
Sourcepub fn poll_ready(
&mut self,
cx: &mut Context<'_>,
send_size: usize,
) -> Poll<Result<()>>
pub fn poll_ready( &mut self, cx: &mut Context<'_>, send_size: usize, ) -> Poll<Result<()>>
Polls the outgoing ring for the ability to send a packet of size
send_size
.
send_size
can be computed by calling try_write
and extracting the
size from TryReadError::Full(send_size)
.
Sourcepub fn poll_empty(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>
pub fn poll_empty(&mut self, cx: &mut Context<'_>) -> Poll<Result<()>>
Polls the outgoing ring for being completely empty, indicating that the other endpoint has read everything.
Sourcepub async fn wait_ready(&mut self, send_size: usize) -> Result<()>
pub async fn wait_ready(&mut self, send_size: usize) -> Result<()>
Waits until there is enough space in the ring to send a packet of size
send_size
.
send_size
can be computed by calling try_write
and extracting the
size from TryReadError::Full(send_size)
.
Sourcepub async fn wait_empty(&mut self) -> Result<()>
pub async fn wait_empty(&mut self) -> Result<()>
Waits until the ring is completely empty, indicating that the other endpoint has read everything.
Sourcepub fn try_send(&mut self, buf: &[u8]) -> Result<()>
pub fn try_send(&mut self, buf: &[u8]) -> Result<()>
Tries to send a datagram, failing with io::ErrorKind::WouldBlock
if
there is not enough space in the ring.
Sourcepub fn try_send_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<()>
pub fn try_send_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<()>
Tries to send a datagram, failing with io::ErrorKind::WouldBlock
if
there is not enough space in the ring.