You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What features would you like from zerocopy?
I'm looking at zerocopy as one of the potential serialization methods in blockchain environment.
Another one will likely be https://github.com/paritytech/parity-scale-codec, which is not as low-level and will be a bit more expensive to work with than casting memory bytes into structs.
What I'm looking for is a way to have some sort of type information or reflection about data structures zerocopy works with, such that external users can understand what blob of bytes contains and display it in human-readable way, auto-generate UI, etc.
Example of UI that can be rendered with such metadata:
It would contain information of the type and all of the fields/variants it contains recursively and exhaustively all the way down to the types from Rust standard library. Implementation for standard library would be a part of zerocopy and the rest derivable my the user on custom data structures. Information about alignment, padding and potentially endianness of the target environment would be included as well.
I was thinking that generating a C data structure might be useful for this purpose, but it will likely be harder to parse than JSON or similar tree-like format and I have not seen derives quite like that either.
The text was updated successfully, but these errors were encountered:
What features would you like from zerocopy?
I'm looking at zerocopy as one of the potential serialization methods in blockchain environment.
Another one will likely be https://github.com/paritytech/parity-scale-codec, which is not as low-level and will be a bit more expensive to work with than casting memory bytes into structs.
What I'm looking for is a way to have some sort of type information or reflection about data structures
zerocopy
works with, such that external users can understand what blob of bytes contains and display it in human-readable way, auto-generate UI, etc.A good example of this is https://github.com/paritytech/scale-info for mentioned
parity-scale-codec
.What
scale-info
allows to do is to generate something like this (used in Substrate-based blockchains to dynamically auto-generate user interfaces):There is a collection of crates that allow to do various manipulations with such type information: https://github.com/paritytech?q=scale&language=rust
Example of UI that can be rendered with such metadata:
It would contain information of the type and all of the fields/variants it contains recursively and exhaustively all the way down to the types from Rust standard library. Implementation for standard library would be a part of
zerocopy
and the rest derivable my the user on custom data structures. Information about alignment, padding and potentially endianness of the target environment would be included as well.I was thinking that generating a C data structure might be useful for this purpose, but it will likely be harder to parse than JSON or similar tree-like format and I have not seen derives quite like that either.
The text was updated successfully, but these errors were encountered: