[Feature]: Expose Serializer and Deserializer as pub?
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
I would like to add CBOR support to a data conversion utility that I've created, which makes use of serde. To do so, I would preferably like to access Deserializer and Serializer directly, rather than through helper methods.
Acceptance Criteria
Ability to use ciborium::{Serializer, Deserializer} from other crates.
Suggestions for a technical implementation
No response
I think this is something that you really need before you claim that you have Serde support. If you don't provide a public Serializer/Deserializer struct implementing those traits it really restricts the ability to efficiently implement custom conversions on top of it (such as using the Visitor pattern with deserialize_any).
+1, ciborium is likely taking an unnecessary hit in my rust_serialization_benchmarks because it only exposes an API for ciborium_io::Read/Write types. All of the input/output buffers are available as contiguous slices, and readers and writers add significant overhead. Compare ciborium vs cbor on the log benchmark:
| Crate | Serialize | Deserialize | Size | Zlib | Zstd |
|---|---|---|---|---|---|
| cbor | 2.2871 ms | 7.6305 ms | 1407835 | 407372 | 324081 |
| ciborium | 4.3776 ms | 12.279 ms | 1407835 | 407372 | 324081 |
A more efficient API surface could be free performance!
This is more or less a duplicate of #18