Skip to content
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

[Rust] Implement Display for encoders and decoders #1051

Open
marciorasf opened this issue Feb 13, 2025 · 1 comment
Open

[Rust] Implement Display for encoders and decoders #1051

marciorasf opened this issue Feb 13, 2025 · 1 comment

Comments

@marciorasf
Copy link

When using sbe-tools to generate java code, the encoders and decoders implement toString() that returns a human-readable representation of all the fields of the message. For example:

[Sequence](sbeTemplateId=9|sbeSchemaId=1|sbeSchemaVersion=3|sbeBlockLength=4):messageType=Sequence|nextSeqNo=629

Having a human-readable representation makes debugging much, much easier, as you can print the SBE messages and check what exactly you're sending/receiving.

When generating rust, currently there's nothing like the java's toString(). The encoders and decoders derive Debug, but it prints just the name of the struct and the buffer, which is not that useful.

Could we implement Display using the exactly same format as Java for both encoders and decoders?

@marciorasf
Copy link
Author

Update: I'm working on it and I expect to submit a proposal soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant