pub struct CobsAccumulator<B: DerefMut<Target = [u8]>> { /* private fields */ }Expand description
Basically postcard’s cobs accumulator, but without the deser part
Implementations§
Source§impl CobsAccumulator<Box<[u8]>>
impl CobsAccumulator<Box<[u8]>>
pub fn new_boxslice(len: usize) -> Self
Source§impl<B: DerefMut<Target = [u8]>> CobsAccumulator<B>
impl<B: DerefMut<Target = [u8]>> CobsAccumulator<B>
Sourcepub fn feed_raw<'me, 'input>(
&'me mut self,
input: &'input mut [u8],
) -> FeedResult<'input, 'me>
pub fn feed_raw<'me, 'input>( &'me mut self, input: &'input mut [u8], ) -> FeedResult<'input, 'me>
Appends data to the internal buffer and attempts to deserialize the accumulated data into
T.
This differs from feed, as it allows the T to reference data within the internal buffer, but
mutably borrows the accumulator for the lifetime of the deserialization.
If T does not require the reference, the borrow of self ends at the end of the function.
Auto Trait Implementations§
impl<B> Freeze for CobsAccumulator<B>where
B: Freeze,
impl<B> RefUnwindSafe for CobsAccumulator<B>where
B: RefUnwindSafe,
impl<B> Send for CobsAccumulator<B>where
B: Send,
impl<B> Sync for CobsAccumulator<B>where
B: Sync,
impl<B> Unpin for CobsAccumulator<B>where
B: Unpin,
impl<B> UnwindSafe for CobsAccumulator<B>where
B: UnwindSafe,
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