Struct bincode_core::BufferWriter [−][src]
An implementation of CoreWrite. This buffer writer will write data to a backing &mut [u8].
Implementations
impl<'a> BufferWriter<'a>[src]
pub fn new(buffer: &'a mut [u8]) -> Self[src]
Create a new writer with a backing buffer.
pub fn written_len(&self) -> usize[src]
The bytes count written to the backing buffer.
pub fn written_buffer(&self) -> &[u8][src]
A slice of the buffer that is in this writer. This is equivalent to getting a slice of the
original buffer with the range ..writer.written_len().
// These two statements are equivalent let buffer_slice = &buffer[..writer.written_len() as usize]; let writer_slice = writer.written_buffer(); assert_eq!(buffer_slice, writer_slice);
Trait Implementations
impl CoreWrite for &mut BufferWriter<'_>[src]
type Error = BufferWriterError
The error that this writer can encounter
fn write(&mut self, val: u8) -> Result<(), Self::Error>[src]
fn flush(&mut self) -> Result<(), Self::Error>[src]
fn write_all(&mut self, val: &[u8]) -> Result<(), Self::Error>[src]
impl CoreWrite for BufferWriter<'_>[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for BufferWriter<'a>
impl<'a> Send for BufferWriter<'a>
impl<'a> Sync for BufferWriter<'a>
impl<'a> Unpin for BufferWriter<'a>
impl<'a> !UnwindSafe for BufferWriter<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,