Struct rustls::Reader[][src]

pub struct Reader<'a> { /* fields omitted */ }
Expand description

A structure that implements std::io::Read for reading plaintext.

Trait Implementations

Obtain plaintext data received from the peer over this TLS connection.

If the peer closes the TLS session cleanly, this returns Ok(0) once all the pending data has been read. No further data can be received on that connection, so the underlying TCP connection should half-closed too.

Note that support close_notify varies in peer TLS libraries: many do not support it and uncleanly close the TCP connection (this might be vulnerable to truncation attacks depending on the application protocol). This means applications using rustls must both handle EOF from this function, and unexpected EOF of the underlying TCP connection.

If there are no bytes to read, this returns Err(ErrorKind::WouldBlock.into()).

You may learn the number of bytes available at any time by inspecting the return of Connection::process_new_packets.

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

🔬 This is a nightly-only experimental API. (read_initializer)

Determines if this Reader can work with buffers of uninitialized memory. 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

Read the exact number of bytes required to fill buf. 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 adaptor which will chain this stream with another. Read more

Creates an adaptor which will read at most limit bytes from it. 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.