Struct git_transport::client::RequestWriter [−][src]
pub struct RequestWriter<'a> { /* fields omitted */ }
A Write
implementation optimized for writing packet lines.
A type implementing Write
for packet lines, which when done can be transformed into a Read
for
obtaining the response.
Implementations
impl<'a> RequestWriter<'a>
[src]
impl<'a> RequestWriter<'a>
[src]pub fn new_from_bufread<W: Write + 'a>(
writer: W,
reader: Box<dyn ExtendedBufRead + 'a>,
write_mode: WriteMode,
on_into_read: MessageKind
) -> Self
[src]
pub fn new_from_bufread<W: Write + 'a>(
writer: W,
reader: Box<dyn ExtendedBufRead + 'a>,
write_mode: WriteMode,
on_into_read: MessageKind
) -> Self
[src]Create a new instance from a writer
(commonly a socket), a reader
into which to transform once the
writes are finished, along with configuration for the write_mode
and information about which message to write
when this instance is converted into a reader
to read the request’s response.
pub fn into_read(self) -> Result<Box<dyn ExtendedBufRead + 'a>>
[src]
pub fn into_read(self) -> Result<Box<dyn ExtendedBufRead + 'a>>
[src]Discard the ability to write and turn this instance into the reader for obtaining the other side’s response.
pub fn write_message(&mut self, message: MessageKind) -> Result<()>
[src]
pub fn write_message(&mut self, message: MessageKind) -> Result<()>
[src]Write the given message as packet line.
Trait Implementations
impl<'a> Write for RequestWriter<'a>
[src]
impl<'a> Write for RequestWriter<'a>
[src]fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]Write a buffer into this writer, returning how many bytes were written. Read more
fn flush(&mut self) -> Result<()>
[src]
fn flush(&mut self) -> Result<()>
[src]Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
fn is_write_vectored(&self) -> bool
[src]
fn is_write_vectored(&self) -> bool
[src]can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]Attempts to write an entire buffer into this writer. Read more
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
[src]
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
[src]write_all_vectored
)Attempts to write multiple buffers into this writer. Read more