-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] #2434: FFI bindgen library #2314
Merged
mversic
merged 15 commits into
hyperledger:iroha2-dev
from
mversic:ffi_common_arg_convert
Jul 22, 2022
Merged
[feature] #2434: FFI bindgen library #2314
mversic
merged 15 commits into
hyperledger:iroha2-dev
from
mversic:ffi_common_arg_convert
Jul 22, 2022
Conversation
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
mversic
commented
Jun 3, 2022
1a880b2
to
4b02d18
Compare
Codecov Report
@@ Coverage Diff @@
## iroha2-dev #2314 +/- ##
==============================================
- Coverage 67.61% 66.77% -0.84%
==============================================
Files 140 145 +5
Lines 26173 27150 +977
==============================================
+ Hits 17696 18130 +434
- Misses 8477 9020 +543
Help us with your feedback. Take ten seconds to tell us how you rate us. |
4b02d18
to
e008574
Compare
e008574
to
aa5d343
Compare
mversic
commented
Jun 3, 2022
mversic
commented
Jun 3, 2022
96ed308
to
65840fc
Compare
Arjentix
reviewed
Jun 4, 2022
65840fc
to
55158fa
Compare
2c64900
to
5c9ef15
Compare
6be3eb2
to
9406231
Compare
outoftardis
reviewed
Jun 7, 2022
9406231
to
d35ecfc
Compare
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
f06bbbe
to
8270fc1
Compare
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
8270fc1
to
586d59a
Compare
s8sato
approved these changes
Jul 22, 2022
Erigara
approved these changes
Jul 22, 2022
mversic
added a commit
to mversic/iroha
that referenced
this pull request
Jul 22, 2022
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
This was referenced Jul 25, 2022
mversic
added a commit
to mversic/iroha
that referenced
this pull request
Sep 6, 2022
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
mversic
added a commit
to mversic/iroha
that referenced
this pull request
Sep 6, 2022
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
mversic
added a commit
to mversic/iroha
that referenced
this pull request
Sep 6, 2022
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
mversic
added a commit
to mversic/iroha
that referenced
this pull request
Sep 7, 2022
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
mversic
added a commit
to mversic/iroha
that referenced
this pull request
Sep 8, 2022
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
mversic
added a commit
to mversic/iroha
that referenced
this pull request
Sep 9, 2022
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
mversic
added a commit
to mversic/iroha
that referenced
this pull request
Sep 9, 2022
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
mversic
added a commit
to mversic/iroha
that referenced
this pull request
Sep 9, 2022
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Marin Veršić marin.versic101@gmail.com
Description of the Change
I've found that often times I need to traverse the type and produce conversions from source to FFI compliant type and vice versa.
There have been a lot of code duplication and convoluted logic which this PR aims to resolve
Traits which enable this happen:
ReprC
,AsReprC
,TryFromReprC
IntoFfi
. ARust
structure is converted into an intermediary FFI struct viaIntoFfi
which implements theAsReprC
and can be converted into a type that can cross FFI boundary. This goes the other way as well - FFIReprC
type is converted into a struct viaTryFromReprC
catch_unwind
to prevent UB when panicking over FFIIssue
Closes #2327
Benefits
Possible Drawbacks
Usage Examples or Tests [optional]
Alternate Designs [optional]