-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
feat: add struct as marshallable field type #87
Conversation
409328c
to
a41ff8c
Compare
a41ff8c
to
c0e5e44
Compare
Codecov Report
@@ Coverage Diff @@
## master #87 +/- ##
==========================================
+ Coverage 74.8% 75.32% +0.51%
==========================================
Files 121 121
Lines 9599 9613 +14
==========================================
+ Hits 7181 7241 +60
+ Misses 2418 2372 -46
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nicely implemented!
@@ -146,6 +146,22 @@ impl StructInfo { | |||
unsafe { slice::from_raw_parts(self.field_sizes, self.num_fields as usize) } | |||
} | |||
} | |||
|
|||
/// Returns the index of the field matching the specified `field_name`. | |||
pub fn find_field_index(struct_info: &StructInfo, field_name: &str) -> Result<usize, String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at some point we should figure out a way to do some sort of hash lookup. Because this might become slow.
c0e5e44
to
ded289b
Compare
Depends on PR #84.
Allows getting, setting and replacing of structs in another struct: