google / rust-async-coap

A flexible, asynchronous library for using and serving CoAP resources in Rust.
Apache License 2.0
51 stars 17 forks source link

async-coap-uri: Rewrite `AnyUriRef::write_resolved` to not depend on allocation #9

Open darconeous opened 5 years ago

darconeous commented 5 years ago

AnyUriRef::write_resolved, as currently written, depends on the std crate, due to the use of dynamically-sized container types. It should be possible to rewrite this method in such a way that this dependency is no longer required.

This issue is the largest impediment to allowing async-coap-uri to work in no-std environments.

Additionally, while the method does currently pass the rather large unit test corpus, the implementation is a bit of a mess. Any re-write should also attempt to make the code easier to follow.