pub struct SliceWrite<'a> { /* private fields */ }
Expand description
Implements Write
for mutable byte slices (&mut [u8]
).
Returns an error if the value to serialize is too large to fit in the slice.
Implementations§
Source§impl<'a> SliceWrite<'a>
impl<'a> SliceWrite<'a>
Sourcepub fn new(slice: &'a mut [u8]) -> SliceWrite<'a>
pub fn new(slice: &'a mut [u8]) -> SliceWrite<'a>
Wraps a mutable slice so it can be used as a Write
.
Sourcepub fn bytes_written(&self) -> usize
pub fn bytes_written(&self) -> usize
Returns the number of bytes written to the underlying slice.
Sourcepub fn into_inner(self) -> &'a mut [u8] ⓘ
pub fn into_inner(self) -> &'a mut [u8] ⓘ
Returns the underlying slice.
Trait Implementations§
Source§impl<'a> Debug for SliceWrite<'a>
impl<'a> Debug for SliceWrite<'a>
impl<'a> Write for SliceWrite<'a>
Auto Trait Implementations§
impl<'a> Freeze for SliceWrite<'a>
impl<'a> RefUnwindSafe for SliceWrite<'a>
impl<'a> Send for SliceWrite<'a>
impl<'a> Sync for SliceWrite<'a>
impl<'a> Unpin for SliceWrite<'a>
impl<'a> !UnwindSafe for SliceWrite<'a>
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