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§
Sourcefn receive_until(
&mut self,
pattern: &[u8],
trim_pattern: bool,
) -> Result<Vec<u8>, PwnIoError>
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
Sourcefn receive_line(&mut self, trim_newline: bool) -> Result<Vec<u8>, PwnIoError>
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
Sourcefn receive(&mut self) -> Result<Vec<u8>, PwnIoError>
fn receive(&mut self) -> Result<Vec<u8>, PwnIoError>
Attempts to read all bytes currently available
Sourcefn receive_all(&mut self) -> Result<Vec<u8>, PwnIoError>
fn receive_all(&mut self) -> Result<Vec<u8>, PwnIoError>
Attempts to read all bytes until the stream ends
Sourcefn receive_count(&mut self, count: usize) -> Result<Vec<u8>, PwnIoError>
fn receive_count(&mut self, count: usize) -> Result<Vec<u8>, PwnIoError>
Attempts to read count
bytes until the stream ends