Struct indexed_file::File[][src]

pub struct File {
    pub inner_file: BufReader<File>,
    // some fields omitted
}
Expand description

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

Fields

inner_file: BufReader<File>

Implementations

Open a new indexed file.

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

Opens a non indexed file and generates the index.

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

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

Returns the total amount of lines of the file.

Returns a reference to the files index.

Trait Implementations

Formats the value using the given formatter. Read more

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

Should seek to the reader used in read_to_eol to the given SeekFrom

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

Reads the given line

Reads the given line and stores into buf

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.