https://github.com/rmja/minicbor-embedded-io
An asynchronous cbor reader/writer for embedded sytems
https://github.com/rmja/minicbor-embedded-io
Last synced: 11 months ago
JSON representation
An asynchronous cbor reader/writer for embedded sytems
- Host: GitHub
- URL: https://github.com/rmja/minicbor-embedded-io
- Owner: rmja
- Created: 2023-02-10T07:09:31.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-24T08:22:07.000Z (about 2 years ago)
- Last Synced: 2024-04-24T13:41:22.567Z (about 2 years ago)
- Language: Rust
- Size: 57.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Async CBOR Reader and Writer
[](https://github.com/rmja/minicbor-embedded-io/actions/workflows/ci.yaml)
[](https://crates.io/crates/minicbor-embedded-io)
[](https://docs.rs/minicbor-embedded-io)
The `minicbor-embedded-io` crate implements async read and write for the `minicbor` crate on top of the `embedded-io-async` `Read` and `Write` traits.
The library is inspired by the way the [Dahomey.Cbor](https://github.com/dahomey-technologies/Dahomey.Cbor) library does asynchronous read and write.
For example, to read an array, one must implement the `CborArrayReader` trait, which is called for each array item.
The callback can either actually read the item, or return an error indicating that it needs more bytes to fully decode - in this case the reader will be called again whenever more bytes become available.