pub struct SerialLines<ReaderTy> { /* private fields */ }Expand description
Reads serial lines from an AsyncBufRead.
This tries to act a lot like the structure returned from .lines() on a
normal async buf reader. Except instead of splitting on \n, we use
\r.
Implementations§
Source§impl<ReaderTy> SerialLines<ReaderTy>where
ReaderTy: AsyncBufRead + Unpin,
impl<ReaderTy> SerialLines<ReaderTy>where
ReaderTy: AsyncBufRead + Unpin,
Source§impl<ReaderTy> SerialLines<ReaderTy>where
ReaderTy: AsyncBufRead,
impl<ReaderTy> SerialLines<ReaderTy>where
ReaderTy: AsyncBufRead,
Sourcepub const fn get_mut(&mut self) -> &mut ReaderTy
pub const fn get_mut(&mut self) -> &mut ReaderTy
Get a mutable reference to the current reader type.
Sourcepub fn poll_next_line(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<IoResult<Option<String>>>
pub fn poll_next_line( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<IoResult<Option<String>>>
Polls for the next line in the stream.
This method returns:
Poll::Pendingif the next line is not yet available.Poll::Ready(Ok(Some(line)))if the next line is available.Poll::Ready(Ok(None))if there are no more lines in this stream.Poll::Ready(Err(err))if an IO error occurred while reading the next line.
When the method returns Poll::Pending, the Waker in the provided
Context is scheduled to receive a wakeup when more bytes become
available on the underlying IO resource. Note that on multiple calls to
poll_next_line, only the Waker from the Context passed to the most
recent call is scheduled to receive a wakeup.
Trait Implementations§
Source§impl<ReaderTy: Debug> Debug for SerialLines<ReaderTy>
impl<ReaderTy: Debug> Debug for SerialLines<ReaderTy>
impl<'__pin, ReaderTy> Unpin for SerialLines<ReaderTy>where
PinnedFieldsOf<__Origin<'__pin, ReaderTy>>: Unpin,
Auto Trait Implementations§
impl<ReaderTy> Freeze for SerialLines<ReaderTy>where
ReaderTy: Freeze,
impl<ReaderTy> RefUnwindSafe for SerialLines<ReaderTy>where
ReaderTy: RefUnwindSafe,
impl<ReaderTy> Send for SerialLines<ReaderTy>where
ReaderTy: Send,
impl<ReaderTy> Sync for SerialLines<ReaderTy>where
ReaderTy: Sync,
impl<ReaderTy> UnwindSafe for SerialLines<ReaderTy>where
ReaderTy: UnwindSafe,
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