martindisch / coap-lite

A lightweight CoAP message manipulation crate, ideal for embedded environments
Other
26 stars 18 forks source link

Add Support for heapless #15

Open jhbruhn opened 3 years ago

jhbruhn commented 3 years ago

Using alloc on embedded devices with highly constrained memory often is difficult because estimation of the required memory is hard. It would be nice if this library would allow using the structures implemented in heapless instead of collections based on alloc.

Of course, that would require additional const generics to pass the allocated memory to the heapless parameters, but I think this is doable. Are there any plans for that to be implemented yet or should I look into it?

martindisch commented 3 years ago

I've been lucky enough to get away with alloc in the project I originally ported this library for, so no plans as of yet. I think it could be challenging, but haven't thought deeply about it. Feel free to give it a shot!

Finomnis commented 7 months ago

I think it would be possible if one replaces all the .into_bytes() and similar into iterators. I might try.