Struct indexed_file::file::File[][src]

pub struct File(_);
Expand description

A wrapper around std::fs::File which implements ReadByLine and holds an index of the lines.

Implementations

Open a new indexed file.

Returns an error if the index is malformed, missing or an io error occurs

Open a non indexed file and generates the index.

Open a non indexed file and uses a custom index index. Expects the index to be properly built.

Creates a new File using an existing _std::io::BufReader and index

Read the whole file into a 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 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

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

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

Convert a file into an IndexedString using the files index and reading the files contents into the memory

The type returned in the event of a conversion error.

Convert a file into an IndexedReader<Vec> using the files index and reading the files contents into the memory

The type returned in the event of a conversion error.

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.