Struct basic_text::TextReader

source ·
pub struct TextReader<Inner: ReadStrLayered> { /* private fields */ }
Expand description

A Read implementation which translates from an input Read implementation producing an arbitrary byte sequence into a valid Basic Text stream.

Examples

use basic_text::TextReader;

let input = TextReader::new(std::io::stdin());

// read from `input`

Implementations§

Construct a new instance of TextReader wrapping inner, which can be anything that implements Read.

Like new, but replaces U+85 (NEL) with U+A instead of U+20.

Like new, but replaces U+2028 (LS) and U+2029 (PS) with U+A instead of U+20.

Construct a new instance of TextReader wrapping inner, which can be anything that implements ReadStrLayered, such as a Utf8Reader.

Like from_utf8, but replaces U+85 (NEL) with U+A instead of U+20.

Like from_utf8, but replaces U+2028 (LS) and U+2029 (PS) with U+A instead of U+20.

Trait Implementations§

Close the resource and abandon any pending buffered contents or errors.
A suggested size, in bytes, for buffering for performance.
Formats the value using the given formatter. Read more
Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
Read all bytes until EOF in this source, placing them into buf. Read more
Read all bytes until EOF in this source, appending them to buf. Read more
Like read, except that it reads into a slice of buffers. Read more
🔬This is a nightly-only experimental API. (can_vector)
Determines if this Reader has an efficient read_vectored implementation. Read more
Read the exact number of bytes required to fill buf. Read more
🔬This is a nightly-only experimental API. (read_buf)
Pull some bytes from this source into the specified buffer. Read more
🔬This is a nightly-only experimental API. (read_buf)
Read the exact number of bytes required to fill cursor. Read more
Creates a “by reference” adaptor for this instance of Read. Read more
Transforms this Read instance to an Iterator over its bytes. Read more
Creates an adapter which will chain this stream with another. Read more
Creates an adapter which will read at most limit bytes from it. Read more
Like Read::read, but also returns a Status.
Some streams require a buffer of at least a certain size.
Like Read::read_vectored, but also returns a Status.
Like Read::read_exact, but uses read_with_status to avoid performing an extra read at the end. Read more
Like read but produces the result in a str. Be sure to check the size field of the return value to see how many bytes were written. Read more
Like read_exact but produces the result in a str.
Like read_with_status but produces the result in a str. Be sure to check the return value to see how many bytes were written. Read more
Like read_exact but produces the result in a str. Read more
Like read_str but for reading Basic Text content. Note that the resulting data may not be a Basic Text string, as it may be eg. a portion of a stream that starts with a non-starter. Read more
Like read_exact_str but for reading Basic Text content. As with read_text, the resulting string may not be a Basic Text string. Read more
Like read_to_string, but reads into a TextString.
Like read_str_with_status but for reading Basic Text data. Note that the resulting data may not be a Basic Text string, as it may be eg. a portion of a stream that starts with a non-starter. Read more
Like read_exact_str_using_status but for reading Basic Text content. As with read_text, the resulting string may not be a Basic Text string. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Extracts the grip.
Extracts the raw grip.
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 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.