pub struct WriteToHeapless<'a, LenT: LenType, S: VecStorage<u8> + ?Sized>(pub &'a mut VecInner<u8, LenT, S>);Expand description
Wrapper around a heapless::Vec that can be written to by minicbor.
The wrapper can generally be short-lived; it updates the vector’s length as it goes. The vector consequently contains incomplete data if encoding errs out prematurely.
§Usage example
use minicbor_adapters::WriteToHeapless;
let mut buf = heapless::Vec::<u8, 32>::new();
minicbor::encode([1, 2, 3], WriteToHeapless(&mut buf)).unwrap();
assert_eq!(&[0x83, 1, 2, 3], &buf);Tuple Fields§
§0: &'a mut VecInner<u8, LenT, S>Trait Implementations§
Source§impl<'a, LenT: Debug + LenType, S: Debug + VecStorage<u8> + ?Sized> Debug for WriteToHeapless<'a, LenT, S>
impl<'a, LenT: Debug + LenType, S: Debug + VecStorage<u8> + ?Sized> Debug for WriteToHeapless<'a, LenT, S>
Auto Trait Implementations§
impl<'a, LenT, S> Freeze for WriteToHeapless<'a, LenT, S>where
S: ?Sized,
impl<'a, LenT, S> RefUnwindSafe for WriteToHeapless<'a, LenT, S>
impl<'a, LenT, S> Send for WriteToHeapless<'a, LenT, S>
impl<'a, LenT, S> Sync for WriteToHeapless<'a, LenT, S>
impl<'a, LenT, S> Unpin for WriteToHeapless<'a, LenT, S>where
S: ?Sized,
impl<'a, LenT, S> !UnwindSafe for WriteToHeapless<'a, LenT, S>
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