Trait netio::Read [] [src]

pub trait Read: Stream {
    fn read(&mut self, buf: &mut [u8]) -> Result<usize>;

    fn chain<R>(self, next: R) -> Chain<Self, R>
    where
        Self: Sized,
        R: Read
, { ... }
fn buffer(self) -> BufReader<Self>
    where
        Self: Sized
, { ... }
fn repeat(self) -> Repeat<Self>
    where
        Self: Sized
, { ... } }

Alternative to std::io::Read

This trait is automatically implemented for all types that implement std::io::Read.

Diffrerences to std::io::Read

Methods that are just wrappers around the equivalent methods of std::io::Read:

  • read
  • chain

New methods that have no counterpart in std::io::Read:

  • buffer
  • repeat

Functions that were removed or moved to a different place, because they cannot be implemented with providing all desired guarantees:

Required Methods

Pull some bytes from this source into the specified buffer, returning how many bytes were read.

This methode is equivalent to std::io::Read::read.

Provided Methods

Creates an adaptor which will chain this stream with another.

This method is equivalent to std::io::Read::chain.

Creates a buffered reader with default capacity and default strategies

Please see the documentation of BufReader for more details

Transforms this reader into a reader that automatically restarts from the beginning after EOF is reached

Implementations on Foreign Types

impl Read for File
[src]

[src]

[src]

[src]

[src]

impl<'a> Read for &'a File
[src]

[src]

[src]

[src]

[src]

impl<R: Read> Read for BufReader<R>
[src]

[src]

[src]

[src]

[src]

impl<T> Read for Cursor<T> where
    T: AsRef<[u8]>, 
[src]

[src]

[src]

[src]

[src]

impl<'a> Read for &'a [u8]
[src]

[src]

[src]

[src]

[src]

impl Read for Empty
[src]

[src]

[src]

[src]

[src]

impl Read for Repeat
[src]

[src]

[src]

[src]

[src]

impl Read for Stdin
[src]

[src]

[src]

[src]

[src]

impl<'a> Read for StdinLock<'a>
[src]

[src]

[src]

[src]

[src]

impl<T: Read, U: Read> Read for Chain<T, U>
[src]

[src]

[src]

[src]

[src]

impl<T: Read> Read for Take<T>
[src]

[src]

[src]

[src]

[src]

impl Read for TcpStream
[src]

[src]

[src]

[src]

[src]

impl<'a> Read for &'a TcpStream
[src]

[src]

[src]

[src]

[src]

impl Read for UnixStream
[src]

[src]

[src]

[src]

[src]

impl<'a> Read for &'a UnixStream
[src]

[src]

[src]

[src]

[src]

impl Read for ChildStdout
[src]

[src]

[src]

[src]

[src]

impl Read for ChildStderr
[src]

[src]

[src]

[src]

[src]

impl<'a, R: Read + ?Sized> Read for &'a mut R
[src]

[src]

[src]

[src]

[src]

impl<R: Read + ?Sized> Read for Box<R>
[src]

[src]

[src]

[src]

[src]

impl<R, Rs, Ms> Read for BufReader<R, Rs, Ms> where
    R: Read,
    Rs: ReadStrategy,
    Ms: MoveStrategy
[src]

[src]

[src]

[src]

[src]

Implementors