Struct diffusion::FileReader [] [src]

pub struct FileReader<T> where T: Read {
    // some fields omitted
}

is a reader that reads from a file. This file needs to be generated by a corresponding writer. Currently it does not support a growing file, e.g. files cannot be modified during read.

Methods

impl<T> FileReader<T> where T: Read
[src]

fn new(file: T) -> Result<FileReader<T>>

returns a new instance of FileReader. It returns error if the file is found corrupted.

Trait Implementations

impl<T: Debug> Debug for FileReader<T> where T: Read
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<T> Reader for FileReader<T> where T: Read
[src]

fn read(&mut self) -> Result<Option<Vec<u8>>>

returns a message if there is one. And returns any error if it cannot return the message. It returns a Ok(None) if file reader has reached to the end of the file, or there is no new message currently, in which case user should retry. Read more