-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce ForeignTypeExt and ForeignTypeRefExt
Inspired by sfackler/rust-openssl#1345. These traits remove a lot of error-prone boilerplate related to casting `*const X::CType` to `*mut X::CType`, and offers APIs to gracefully handle null pointers returned from the underlying c++ code. As an example, not every X509 certificate has a subject key id available. Instead of panicking when a user attempts to parse a subject key id on a certificate that doesn't have one, we return an `Option`. For now, I've implemented some getters in the x509 bindings using the new traits, as that will avoid a breaking change. Before a 5.0 release, the plan is to onboard all applicable bindings to this new trait.
- Loading branch information
1 parent
c88f335
commit c087942
Showing
3 changed files
with
41 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters