Rust full reflection
Compared to the C++ implementation of the reflection feature,
It includes:
- Helper functions to access schema
- Full reflection - getters for scalar/string/struct/table/vector types
- Full reflection - setters for scalar/string types
- Verification of buffer
- Tests for above
It doesn't include:
- Getter for
VectorOfAny(Vector without element type specified) - Setter from another buffer, and converting buffer to builder
TODOs on C++ side are retained.
@candysonya @dextero We are using flatbuffers at work and I have a small patch that allows us to have zero-allocation of flatbuffer messages. I noticed that this change makes all the &'static str into String. Is this strictly necessary? Could it be Cow<'static, str>?
@candysonya @dextero We are using flatbuffers at work and I have a small patch that allows us to have zero-allocation of flatbuffer messages. I noticed that this change makes all the &'static str into String. Is this strictly necessary? Could it be Cow<'static, str>?
Thanks for pointing it out! I've just updated the change with Cow<'static, str>.
Thank you for making the changes to
Cow<'static, str>. This is an awesome patch set and I'm really excited to have reflection! My comments are a few cases where you used.to_string()but I believe that.into()should work instead to make the value into aCowand not aString. I could be wrong though and in that case feel free to ignore my comments
Thanks so much for spotting that!