PwnIoRead

Trait PwnIoRead 

Source
pub trait PwnIoRead {
    // Required methods
    fn receive_until(
        &mut self,
        pattern: &[u8],
        trim_pattern: bool,
    ) -> Result<Vec<u8>, PwnIoError>;
    fn receive_line(
        &mut self,
        trim_newline: bool,
    ) -> Result<Vec<u8>, PwnIoError>;
    fn receive(&mut self) -> Result<Vec<u8>, PwnIoError>;
    fn receive_all(&mut self) -> Result<Vec<u8>, PwnIoError>;
    fn receive_count(&mut self, count: usize) -> Result<Vec<u8>, PwnIoError>;
}
Expand description

Trait for read IO operations

Required Methods§

Source

fn receive_until( &mut self, pattern: &[u8], trim_pattern: bool, ) -> Result<Vec<u8>, PwnIoError>

Attempts to read from the stream until the pattern specified in bytes is reached, optionally trimming the pattern from the returned bytes

Source

fn receive_line(&mut self, trim_newline: bool) -> Result<Vec<u8>, PwnIoError>

Attempts to read from the stream until it reaches a newline character, optionally trimming the newline from the returned bytes

Source

fn receive(&mut self) -> Result<Vec<u8>, PwnIoError>

Attempts to read all bytes currently available

Source

fn receive_all(&mut self) -> Result<Vec<u8>, PwnIoError>

Attempts to read all bytes until the stream ends

Source

fn receive_count(&mut self, count: usize) -> Result<Vec<u8>, PwnIoError>

Attempts to read count bytes until the stream ends

Implementors§

Source§

impl<T> PwnIoRead for T
where T: Read,