pub struct Writer(/* private fields */);
Expand description
Write access to a nonblocking ring buffer with fixed capacity.
If there is no space in the buffer to write to, the current task is parked and notified once space becomes available.
Implementations§
Trait Implementations§
Source§impl AsyncWrite for Writer
impl AsyncWrite for Writer
Source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize>>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], ) -> Poll<Result<usize>>
Write data to the RingBuffer.
This only returns Ok(Ready(0))
if either buf.len() == 0
, poll_close
has been called,
or if the corresponding Reader
has been dropped and no more data will be read to free up
space for new data.
§Errors
This never emits an error.
Source§fn poll_flush(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Result<()>>
§Errors
This never emits an error.
Auto Trait Implementations§
impl Freeze for Writer
impl !RefUnwindSafe for Writer
impl !Send for Writer
impl !Sync for Writer
impl Unpin for Writer
impl !UnwindSafe for Writer
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