Struct indexed_file::bufreader::IndexedBufReader[][src]

pub struct IndexedBufReader<R: Read + Unpin + Seek + Send> {
    pub reader: BufReader<R>,
    // some fields omitted
}
Expand description

A wrapper around BufReader<R> which implements ReadByLine and holds an index of the lines.

Fields

reader: BufReader<R>

Implementations

Creates a new IndexedBufReader using a BufReader and an index. The index won’t be validated. Using a malformed index won’t return an error but make the IndexedBufReader useless.

Creates a new IndexedBufReader with the current index. reader should contain the same data used in &self or the index might be invalid for the given reader

Read the IndexedBufReader into a newly allocated string

Trait Implementations

Formats the value using the given formatter. Read more

Returns a reference to the files index.

Returns the total amount of lines in the file without the lines used by the index.

Should return the offset to seek to given the line-index

Should read from the current position until the end of the line, omitting the \n

Should seek the file to the given line line

Write the index, followed by the files contents into writer. A file generated using this function will always be parsable by File::open. Read more

Reads the given line

Reads the given line and stores into buf

Do a binary search on ReadByLine implementing Types, since it provides everything required for binary search. Only works with sorted files Read more

Do a binary search by on ReadByLine implementing Types, since it provides everything required for binary search. Only works with sorted files Read more

Do a binary search on ReadByLine implementing Types, since it provides everything required for binary search. Only works with sorted files Read more

Do a binary search by on ReadByLine implementing Types, since it provides everything required for binary search. Only works with sorted files Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.