cbor
cbor copied to clipboard
Implement `de::from_slice_count`
Add a function that deserializes first valid cbor value out of a slice of bytes and returns the number of consumed bytes.
@firstyear and I would really like this functionality for our work in kanidm/webauthn-rs, where we need to parse cbor values out of byte streams.
I'm also somewhat curious about why I have to subtract one off of the error's offset.
Is there somewhere within the serde_cbor codebase where this could be added as an example usage?
Is there somewhere within the serde_cbor codebase where this could be added as an example usage?
Maybe in from_slice? @dtolnay, would you accept a PR adding such an example to the doc string?