pub struct Writer<W: Write> { /* private fields */ }Expand description
Writes packets to an underlying Write.
Implementations§
Source§impl<W: Write> Writer<W>
impl<W: Write> Writer<W>
pub fn new(inner: W) -> Self
Sourcepub fn write_packet(&mut self, data: &[u8]) -> Result<()>
pub fn write_packet(&mut self, data: &[u8]) -> Result<()>
Write a packet of arbitrary bytes. Errors if data.len() > MAX_PACKET_DATA.
Sourcepub fn write_text(&mut self, text: &str) -> Result<()>
pub fn write_text(&mut self, text: &str) -> Result<()>
Write a text packet, appending a single \n (the convention git uses).
Sourcepub fn write_flush(&mut self) -> Result<()>
pub fn write_flush(&mut self) -> Result<()>
Write a flush packet (0000).
Auto Trait Implementations§
impl<W> Freeze for Writer<W>where
W: Freeze,
impl<W> RefUnwindSafe for Writer<W>where
W: RefUnwindSafe,
impl<W> Send for Writer<W>where
W: Send,
impl<W> Sync for Writer<W>where
W: Sync,
impl<W> Unpin for Writer<W>where
W: Unpin,
impl<W> UnsafeUnpin for Writer<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for Writer<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more