pub struct TextReader<R: BufRead> { /* private fields */ }
Expand description

A stream reader for large text file

Implementations§

👎Deprecated: Use TextReader::try_from_path instead

Build a text reader for file from path p.

Build a text reader for file from path p.

Build a text reader for string slice.

Build a text reader from a struct implementing Read trait.

Skip reading until finding a matched line. Return the position before the matched line. Return error if not found.

Read a new line into buf. Note: the new line is forced to use unix style line ending.

This function will return the total number of bytes read.

If this function returns None, the stream has reached EOF.

Returns an iterator over the lines of this reader. Each string returned will not have a line ending.

Read all text into string buf (Note: out of memory issue for large file)

Returns an iterator over part of text, using a generic text partioner p.

Returns an iterator over each part of text in n lines.

Returns an iterator over a part of text terminated with a tail line.

Returns an iterator over a part of text preceded with a head line.

Trait Implementations§

Formats the value using the given formatter. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
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.