Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The common embedded string type
heapless::String
is not supported in minicbor; neither are other common heapless types. Its implementation largely follows that of thealloc::…::String
, although it takes a slightly different choice for encoding by fully deferring to the deref'dstr
.Without introducing extra wrappers, this can only be done either in
heapless
or here. Whileheapless
does implement serialization forserde
, following the pattern of "smaller crate provides implementations for larger crate" and "unstable crate provides implementations for unstable crate", this would best sit here. (heapless
is also unstable, but rather slow in breaking things.)This PR adds support for
heapless::String
only. It is designed for early review as a test balloon – if the way this is done is fine for you, I'd add at leastheapless::Vec
(followingalloc::…::Vec
), if you prefer already in this PR. There are more types that could be expressed (heapless
itself providesserde
implementations also for itsBinaryHeap
,IndexSet
,LinearMap
andIndexMap
), but as I have no experience with them, I'd defer them to implementation as needed, unless you insist on full coverage.