diff --git a/library/std/src/io/buffered/bufwriter.rs b/library/std/src/io/buffered/bufwriter.rs index 067ed6ba7ff50..cd5ac436c7ed4 100644 --- a/library/std/src/io/buffered/bufwriter.rs +++ b/library/std/src/io/buffered/bufwriter.rs @@ -241,6 +241,20 @@ impl BufWriter { &self.buf } + /// FIXME Document. + #[inline] + #[unstable(feature = "bufwriter_raw_buffer", issue = "79916")] + pub fn as_ptr(&mut self) -> *const u8 { + self.buf.as_ptr() + } + + /// FIXME Document. + #[inline] + #[unstable(feature = "bufwriter_raw_buffer", issue = "79916")] + pub fn as_mut_ptr(&mut self) -> *mut u8 { + self.buf.as_mut_ptr() + } + /// Returns the number of bytes the internal buffer can hold without flushing. /// /// # Examples @@ -261,6 +275,20 @@ impl BufWriter { self.buf.capacity() } + /// FIXME Document. + #[inline] + #[unstable(feature = "bufwriter_raw_buffer", issue = "79916")] + pub fn len(&self) -> usize { + self.buf.len() + } + + /// FIXME Document. + #[inline] + #[unstable(feature = "bufwriter_raw_buffer", issue = "79916")] + pub unsafe fn set_len(&mut self, new_len: usize) { + self.buf.set_len(new_len); + } + /// Unwraps this `BufWriter`, returning the underlying writer. /// /// The buffer is written out before returning the writer.