namib-project / libcoap-rs

Rust bindings to and wrapper around the libcoap C library
BSD 2-Clause "Simplified" License
7 stars 1 forks source link

Rework of message and option parsing #21

Open pulsastrix opened 3 months ago

pulsastrix commented 3 months ago

The current way that messages and options are handled is rather inefficient, as it requires cloning most CoAP options when converting from and to raw messages.

A main reason for why this is necessary is that the message types are mutable, which requires message construction to only happen at the very end.

In order to reduce this overhead and get closer to a "zero-cost abstraction", I propose making the following changes: