[][src]Trait cntrlr::io::ReadExt

pub trait ReadExt: Read {
    type ExactFuture: Future<Output = Result<(), Self::Error>> + 'a;
    type LineFuture: Future<Output = Result<(), LineError<Self::Error>>> + 'a;
    pub fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> Self::ExactFuture;
pub fn read_line<'a>(&'a mut self, buf: &'a mut String) -> Self::LineFuture; }

Extended functions for reading bytes

Associated Types

type ExactFuture: Future<Output = Result<(), Self::Error>> + 'a[src]

The future for Self::read_exact()

type LineFuture: Future<Output = Result<(), LineError<Self::Error>>> + 'a[src]

The future for Self::read_line()

Loading content...

Required methods

pub fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> Self::ExactFuture[src]

Read bytes from the device

This reads exactly buf.len() bytes from the device.

pub fn read_line<'a>(&'a mut self, buf: &'a mut String) -> Self::LineFuture[src]

Read a line from the device

This reads bytes from the device into the passed String until it reaches a newline (0x0A). The newline will also be included in the output string.

Loading content...

Implementors

impl<T: Read + 'static> ReadExt for T[src]

type ExactFuture = impl Future<Output = Result<(), Self::Error>> + 'a

type LineFuture = impl Future<Output = Result<(), LineError<Self::Error>>> + 'a

Loading content...