Due to some issues with the Python cbor2 library, I decided to add deserialization support to pycddl. My prototype works great, and will hopefully release this soon.
The issue is that currently I need to parse the CBOR twice, or clone the parsed value resulting in extra memory usage, because:
cddl::validator::cbor::CBORValidator takes ownership of the ciborium::cbor::Value.
There is no way to extract that value back out once validation is over.
This should be solvable by adding a method to CBORValidator that takes self and returns the Value back out. If you have a specific way you'd prefer this done (extract_value()? impl From<CBORValidator> for ciborium::cbor::Value?) let me know, I can submit a PR either way. Or I'll just choose one if you don't have an opinion.
Due to some issues with the Python
cbor2
library, I decided to add deserialization support to pycddl. My prototype works great, and will hopefully release this soon.The issue is that currently I need to parse the CBOR twice, or clone the parsed value resulting in extra memory usage, because:
cddl::validator::cbor::CBORValidator
takes ownership of theciborium::cbor::Value
.This should be solvable by adding a method to
CBORValidator
that takesself
and returns theValue
back out. If you have a specific way you'd prefer this done (extract_value()
?impl From<CBORValidator> for ciborium::cbor::Value
?) let me know, I can submit a PR either way. Or I'll just choose one if you don't have an opinion.