pub struct Stream<'a, C: 'a + ?Sized, T: 'a + Read + Write + ?Sized> {
pub conn: &'a mut C,
pub sock: &'a mut T,
}
Available on crate feature std
only.
This type implements io::Read
and io::Write
, encapsulating a Connection C
and an underlying transport T
, such as a socket.
Relies on ConnectionCommon::complete_io()
to perform the necessary I/O.
This allows you to use a rustls Connection like a normal stream.
Our TLS connection
The underlying transport, like a socket
Source§ SourceMake a new Stream using the Connection conn
and socket-like object sock
. This does not fail and does no IO.
Returns the contents of the internal buffer, filling it with more data, via
Read
methods, if empty.
Read more Source§Marks the given
amount
of additional bytes from the internal buffer as having been read. Subsequent calls to
read
only return bytes that have not been marked as read.
Read more Source§🔬This is a nightly-only experimental API. (buf_read_has_data_left
)
Checks if there is any data left to be
read
.
Read more 1.0.0 · Source§Reads all bytes into
buf
until the delimiter
byte
or EOF is reached.
Read more 1.83.0 · Source§Skips all bytes until the delimiter
byte
or EOF is reached.
Read more 1.0.0 · Source§Reads all bytes until a newline (the
0xA
byte) is reached, and append them to the provided
String
buffer.
Read more 1.0.0 · Source§Returns an iterator over the contents of this reader split on the byte
byte
.
Read more 1.0.0 · Source§Returns an iterator over the lines of this reader.
Read more Source§ Source§ Source§Pull some bytes from this source into the specified buffer, returning how many bytes were read.
Read more Source§🔬This is a nightly-only experimental API. (read_buf
)
Pull some bytes from this source into the specified buffer.
Read more 1.36.0 · Source§Like
read
, except that it reads into a slice of buffers.
Read more Source§🔬This is a nightly-only experimental API. (can_vector
)
Determines if this
Read
er has an efficient
read_vectored
implementation.
Read more 1.0.0 · Source§Reads all bytes until EOF in this source, placing them into
buf
.
Read more 1.0.0 · Source§Reads all bytes until EOF in this source, appending them to
buf
.
Read more 1.6.0 · Source§Reads the exact number of bytes required to fill
buf
.
Read more Source§🔬This is a nightly-only experimental API. (read_buf
)
Reads the exact number of bytes required to fill
cursor
.
Read more 1.0.0 · Source§Creates a “by reference” adaptor for this instance of
Read
.
Read more 1.0.0 · Source§ 1.0.0 · Source§Creates an adapter which will chain this stream with another.
Read more 1.0.0 · Source§Creates an adapter which will read at most
limit
bytes from it.
Read more Source§ Source§Writes a buffer into this writer, returning how many bytes were written.
Read more Source§ Source§Flushes this output stream, ensuring that all intermediately buffered contents reach their destination.
Read more Source§🔬This is a nightly-only experimental API. (can_vector
)
Attempts to write an entire buffer into this writer.
Read more Source§🔬This is a nightly-only experimental API. (write_all_vectored
)
Attempts to write multiple buffers into this writer.
Read more 1.0.0 · Source§Writes a formatted string into this writer, returning any error encountered.
Read more 1.0.0 · Source§Creates a “by reference” adapter for this instance of
Write
.
Read moreRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4