Skip to content

Add cbor2 to implementation list#113

Open
zensh wants to merge 4 commits into
cbor:masterfrom
zensh:chore/add-cbor2-to-impls
Open

Add cbor2 to implementation list#113
zensh wants to merge 4 commits into
cbor:masterfrom
zensh:chore/add-cbor2-to-impls

Conversation

@zensh

@zensh zensh commented Jun 24, 2026

Copy link
Copy Markdown

Add cbor2 to the Rust implementations list on https://cbor.io/impls.html with links to crates.io and GitHub.

Copilot AI review requested due to automatic review settings June 24, 2026 07:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the Rust cbor2 library to the CBOR implementations page (impls.html) so visitors can discover it alongside other Rust CBOR crates.

Changes:

  • Added a new Rust implementation entry for cbor2.
  • Included links to the crate on crates.io and the source repository on GitHub.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread impls.html Outdated
Comment on lines +115 to +117
<p>The cbor2 implementation, available on
<a href="https://crates.io/crates/cbor2">crates.io</a>, supports CBOR tags
and a no_std/no_alloc feature matrix:</p>
Comment thread impls.html Outdated
<a href="https://crates.io/crates/cbor2">crates.io</a>. It supports:
async item I/O, serde round trips, canonical and deterministic encoding,
Value/RawValue, semantic tags, COSE integer keys and arrays,
validation, diagnostic notation, and no_std.</p>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now you got me curious: How do you do validation? (I'm asking because maybe there should be an adjective there that reveals this.)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you — that is a good question, and I realize “validation” was too vague here.

What I meant is cbor2::validate: it checks that the input is exactly one well-formed CBOR item, including structural validity, nesting limits, text UTF-8, and no trailing bytes, without deserializing into a Rust type. So it is meant as a lightweight well-formedness / exact-one-item validation pass, not schema or application-level validation.

Would “well-formedness validation” or “exact-one-item validation” be a better phrase here? I’m happy to adjust the wording.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

", with separately available well-formedness check" would be a good summary, I think.
(Validation usually implies conformance to some application protocol.)

Comment thread impls.html Outdated
for Rust, available on
<a href="https://crates.io/crates/cbor2">crates.io</a>. It supports:
async item I/O, serde round trips, canonical and deterministic encoding,
Value/RawValue, semantic tags, COSE integer keys and arrays,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"COSE integer keys and arrays" is a weird combination -- I'm assuming you support integer keys for maps, like they are used in COSE and many other protocols, and arrays (but is the latter noteworthy?)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right — I compressed several things into a phrase that reads oddly.

What I meant is that #[derive(cbor2::Cbor)] supports integer map keys, such as the labels used by COSE / CWT-style structures, and also CBOR tags. Separately, it can represent array-shaped structs, which is useful for COSE-like structures such as COSE_Sign1, but “arrays” by itself is probably not noteworthy enough in this list.

I can reword this to something like:

“COSE-style integer map keys, semantic tags, and derive support for tagged / array-shaped structures”

or simply:

“COSE-style integer map keys and semantic tags”

if you prefer the shorter version.

zensh and others added 2 commits June 24, 2026 17:15
@zensh

zensh commented Jun 24, 2026

Copy link
Copy Markdown
Author

Thank you, that makes sense. I updated the summary to use “with separately available well-formedness check”, and also aligned the cbor2 README / Cargo metadata with this wording.

If this looks good now, would you mind merging it? Thanks again for the careful review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants