pub struct Writer<'a> {
sink: &'a mut dyn PlaintextSink,
}Expand description
A structure that implements std::io::Write for writing plaintext.
Fields§
§sink: &'a mut dyn PlaintextSinkImplementations§
Source§impl<'a> Writer<'a>
impl<'a> Writer<'a>
Sourcepub(crate) fn new(sink: &'a mut dyn PlaintextSink) -> Self
pub(crate) fn new(sink: &'a mut dyn PlaintextSink) -> Self
Create a new Writer.
This is not an external interface. Get one of these objects
from Connection::writer.
Trait Implementations§
Source§impl Write for Writer<'_>
impl Write for Writer<'_>
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Send the plaintext buf to the peer, encrypting
and authenticating it. Once this function succeeds
you should call Connection::write_tls which will output the
corresponding TLS records.
This function buffers plaintext sent before the
TLS handshake completes, and sends it as soon
as it can. See ConnectionCommon::set_buffer_limit to control
the size of this buffer.
If the connection previously encountered a fatal error (for example, while
processing received data in Connection::process_new_packets), this returns
that error, even if buf is empty.
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
This does not do any I/O, but returns the fatal error the connection previously encountered, if any.
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored)