pub struct WriteBatch<'a, M: RingMem> { /* private fields */ }
Expand description
A batch writer, returned by WriteHalf::batched
.
Implementations§
Source§impl<M: RingMem> WriteBatch<'_, M>
impl<M: RingMem> WriteBatch<'_, M>
Sourcepub fn can_write(&mut self, send_size: usize) -> Result<bool, Error>
pub fn can_write(&mut self, send_size: usize) -> Result<bool, Error>
Checks the outgiong ring for the capacity to send a packet of size
send_size
.
Sourcepub fn try_write(
&mut self,
packet: &OutgoingPacket<'_, '_>,
) -> Result<(), TryWriteError>
pub fn try_write( &mut self, packet: &OutgoingPacket<'_, '_>, ) -> Result<(), TryWriteError>
Tries to write a packet into the outgoing ring.
Fails with TryReadError::Full(send_size)
if the ring is full.
Trait Implementations§
Auto Trait Implementations§
impl<'a, M> Freeze for WriteBatch<'a, M>
impl<'a, M> !RefUnwindSafe for WriteBatch<'a, M>
impl<'a, M> Send for WriteBatch<'a, M>where
M: Sync,
impl<'a, M> Sync for WriteBatch<'a, M>where
M: Sync,
impl<'a, M> Unpin for WriteBatch<'a, M>
impl<'a, M> !UnwindSafe for WriteBatch<'a, M>
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