Struct git_transport::client::RequestWriter
source · [−]pub struct RequestWriter<'a> { /* private fields */ }
Expand description
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
sourceimpl<'a> RequestWriter<'a>
impl<'a> RequestWriter<'a>
methods with bonds to IO
sourcepub fn new_from_bufread<W: Write + 'a>(
writer: W,
reader: Box<dyn ExtendedBufRead + Unpin + 'a>,
write_mode: WriteMode,
on_into_read: MessageKind
) -> Self
pub fn new_from_bufread<W: Write + 'a>(
writer: W,
reader: Box<dyn ExtendedBufRead + Unpin + 'a>,
write_mode: WriteMode,
on_into_read: MessageKind
) -> Self
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.
sourcepub fn write_message(&mut self, message: MessageKind) -> Result<()>
pub fn write_message(&mut self, message: MessageKind) -> Result<()>
Write the given message as packet line.
Trait Implementations
sourceimpl<'a> Write for RequestWriter<'a>
impl<'a> Write for RequestWriter<'a>
sourcefn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer into this writer, returning how many bytes were written. Read more
sourcefn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
sourcefn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
1.0.0 · sourcefn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
sourcefn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations
impl<'a> !RefUnwindSafe for RequestWriter<'a>
impl<'a> !Send for RequestWriter<'a>
impl<'a> !Sync for RequestWriter<'a>
impl<'a> Unpin for RequestWriter<'a>
impl<'a> !UnwindSafe for RequestWriter<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more