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 const fn new(slice: &'a mut [u8]) -> Self
pub const fn new(slice: &'a mut [u8]) -> Self
Wraps a mutable slice so it can be used as a Write.
Sourcepub const fn bytes_written(&self) -> usize
pub const fn bytes_written(&self) -> usize
Returns the number of bytes written to the underlying slice.
Sourcepub const fn into_inner(self) -> &'a mut [u8] ⓘ
pub const 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 Write for SliceWrite<'_>
Auto Trait Implementations§
impl<'a> !UnwindSafe for SliceWrite<'a>
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> UnsafeUnpin 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