Skip to content

Redesign most everything.#86

Draft
partim wants to merge 26 commits intomainfrom
everything-revisited
Draft

Redesign most everything.#86
partim wants to merge 26 commits intomainfrom
everything-revisited

Conversation

@partim
Copy link
Copy Markdown
Member

@partim partim commented May 22, 2025

This PR redesigns nearly all aspects of bcder. Its original aim was to make the crate panic-free but in the process I decided to redesign the whole API around byte slices rather than using Bytes.

The decoding part now doesn’t rely on closures any more but those methods are still provided since closures may actually convenient. We’ve renamed the methods in an attempt to create a better naming scheme. The old names are still provided for easier transition.

This PR currently does not include the old capturing mechanism. I am kind of hoping we can get away without this mechanism. If you do need it, please let me know. We are currently using it in rpki-rs, so I’ll likely also discover if we can’t get away without it.

This PR is most definitely a breaking change.

This PR is definitely still in draft status. Here’s a list of things still need to be done:

  • tests, tests, tests,
  • complete type and method documentation,
  • new intro documentation,
  • allow borrowing from a Primitive if the underlying source already has the complete data,
  • replace slice indexing and allow attributes with unsafe get_unchecked which is what it is.

There is probably more.

@partim partim marked this pull request as draft May 22, 2025 09:39
@partim
Copy link
Copy Markdown
Member Author

partim commented Jul 15, 2025

I have now added capturing back in. Turns out there are things in X.509 (like, say, Name) where you just want to keep the encoded value around and not care about it.

The mechanism works in principle but hasn’t been tested.

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.

1 participant