Struct serde_cbor::ser::SliceWrite
source · 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.