Skip to content

Draft: [RUST] Generate human-readable representation of decoders fields #1056

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

Draft
wants to merge 90 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
c3079e1
Save progress
Feb 18, 2025
9809b45
Fix Either.
Feb 18, 2025
aa15dc7
Fix set.
Feb 18, 2025
9b237dd
Fix Option display.
Feb 18, 2025
04a13d2
Add TODO.
Feb 18, 2025
828d39c
Fix composite formatting.
Feb 18, 2025
d4afe7e
Undo formatting changes.
Feb 18, 2025
943ce2d
Undo formatting changes.
Feb 18, 2025
f1f9088
Use separator.
Feb 18, 2025
6db3d64
Remove TODO.
Feb 18, 2025
ace17b6
Improve generated code.
Feb 18, 2025
e7f49e3
Improve generated code.
Feb 18, 2025
3cfb4a5
Decrease changes in this MR.
Feb 18, 2025
bdcf689
Enclose set.
Feb 18, 2025
4b296bd
Improve comment.
Feb 18, 2025
1972497
Fix lifetimes.
Feb 19, 2025
dc280f9
Use block instead of dropping reference.
Feb 19, 2025
bc1886e
Avoid trailing commas.
Feb 19, 2025
2ee90d7
Fix display of groups.
Feb 20, 2025
3d52ab9
Rename trait to SbeToString.
Mar 11, 2025
48b0955
Improve comment.
Mar 11, 2025
f67d268
Reduce duplication.
Mar 12, 2025
83b8426
Format code.
Mar 12, 2025
5d2c03d
Revert undesired changes
Mar 12, 2025
66946b8
Merge branch 'master' of github.com:marciorasf/simple-binary-encoding…
Mar 18, 2025
070e007
Fix SbeToString docstring.
Mar 18, 2025
df2224e
[CI] Enable JDK 24 GA.
vyazelenko Mar 18, 2025
68a0a5b
[Rust] Elide explicit ActingVersion lifetime. (#1053)
gierlachg Mar 21, 2025
21757de
[Java] Adjust Java DTO Choice Set Access (#1064)
marc-adaptive Apr 6, 2025
27564a3
Bump `Mockito` to 5.17.0.
vyazelenko Apr 7, 2025
623b424
Bump `Checkstyle` to 10.23.0.
vyazelenko Apr 7, 2025
177f006
Checkstyle fixes.
vyazelenko Apr 7, 2025
5afcc70
[CI] Use `gradle/actions/setup-gradle` action for caching Gradle depe…
vyazelenko Apr 9, 2025
31c06c0
[Java] Bump `JUnit` to 5.12.2.
vyazelenko Apr 14, 2025
fee53b0
[Java] Bump `Gradle` to 8.14.
vyazelenko Apr 28, 2025
c22df5d
[Java] Bump `Checkstyle` to 10.23.1.
vyazelenko Apr 28, 2025
1980d5c
[CI] Remove Ubuntu 20.04 based builds as Github no longer supports th…
vyazelenko Apr 28, 2025
64b07d6
[CI] Add GCC 15 and Clang 19,20 to the build matrix.
vyazelenko Apr 28, 2025
10aa223
[CI] Remove GCC 15 as it is not yet available.
vyazelenko Apr 28, 2025
5ca65cc
[CI] Bump Go build to use 1.23.x and 1.24.x.
vyazelenko Apr 28, 2025
9bf8a2a
[Rust] get proper version for composite types. (#1058)
marciorasf Apr 29, 2025
1a982f0
[C#] Read NuGet package version from version file (#1061)
pirrmann Apr 29, 2025
40ee1b3
[C#] Enable dual build for netstandard2.0 & netstandard2.1
Mar 21, 2025
9c1f846
[Java] Bump `Mockito` to 5.18.0.
vyazelenko May 21, 2025
a9ef7b5
[Java] Bump `Json` to 20250517.
vyazelenko May 21, 2025
937efb9
[Java] Bump `Gradle` to 8.14.1.
vyazelenko May 26, 2025
2de60b7
[Java] Bump `Checkstyle` to 10.24.0.
vyazelenko May 26, 2025
ae3b29c
[Doc] Add `CHANGELOG.md`.
vyazelenko May 26, 2025
a883c9d
[Java] Bump `Agrona` to 2.2.0.
vyazelenko May 26, 2025
223ba39
1.35.0 released.
vyazelenko May 26, 2025
7b9db66
post release bump
vyazelenko May 26, 2025
dc6c2a9
[Java] Bump `JUnit` to 5.13.0.
vyazelenko May 30, 2025
bf1ed76
[Java] Bump `Agrona` to 2.2.1.
vyazelenko Jun 2, 2025
9f9d639
[Doc] Add release notes.
vyazelenko Jun 2, 2025
d6b5484
1.35.1 released.
vyazelenko Jun 2, 2025
943815f
post release bump
vyazelenko Jun 2, 2025
9c841d6
[Java] Bump `Checkstyle` to 1.25.0.
vyazelenko Jun 4, 2025
3fc3690
[Java] Bump `Gradle` 8.14.2.
vyazelenko Jun 6, 2025
6dde3cc
[Java] Bump `Agrona` to 2.2.2.
vyazelenko Jun 6, 2025
e8b43b8
[Java] Publish artifacts to Central Portal using OSSRH Staging API.
vyazelenko Jun 6, 2025
2d45c87
1.35.2 released.
vyazelenko Jun 6, 2025
39a54ff
post release bump
vyazelenko Jun 6, 2025
098583a
Update doc.
vyazelenko Jun 6, 2025
02b35db
[Java] Task invocation bug.
vyazelenko Jun 6, 2025
2bf9b92
1.35.3 released.
vyazelenko Jun 6, 2025
8dad5ea
post release bump
vyazelenko Jun 6, 2025
caf6591
[Java] Bump `JUnit` to 5.13.1.
vyazelenko Jun 7, 2025
3ddcc22
[Java] Adjust Java Dto generateComputeEncodedLength to acount for cha…
marc-adaptive Jun 10, 2025
7174162
Return None for optional primite field if its version is less than ac…
marciorasf Jun 11, 2025
9439d36
[CI] Use `macos-15`.
vyazelenko Jun 11, 2025
179a97f
[Java] Bump `jqwik` to 1.9.3.
vyazelenko Jun 12, 2025
29a58f4
[Doc] Release notes.
vyazelenko Jun 12, 2025
7eedac7
1.35.4 released.
vyazelenko Jun 12, 2025
f4855b9
post release bump
vyazelenko Jun 12, 2025
fcc57f2
[Java/C++/C#] Fix a bug in overzealous DTO validation (#1073)
ZachBray Jun 20, 2025
44680d0
[Doc] Release notes.
vyazelenko Jun 20, 2025
0eeed0f
[Java] Bump `Aeron` to 2.2.3.
vyazelenko Jun 20, 2025
b066bc6
1.35.5 released.
vyazelenko Jun 20, 2025
609aba2
post release bump
vyazelenko Jun 20, 2025
9856285
[Java] Update CHANGELOG.
ZachBray Jun 20, 2025
fd27336
[Java] Bump `Checkstyle` to 10.25.1.
vyazelenko Jun 24, 2025
ccd2329
[Java] Bump `Shadow` to 8.3.7.
vyazelenko Jun 24, 2025
5abbe64
[Java] Bump `Checkstyle` to 10.26.0.
vyazelenko Jun 26, 2025
1804225
[Java] Bump `JUnit` to 5.13.2.
vyazelenko Jun 26, 2025
1c50755
[Java] Bump `Agrona` to 2.2.4.
vyazelenko Jun 27, 2025
a59baff
1.35.6 released.
vyazelenko Jun 27, 2025
a11d75f
post release bump
vyazelenko Jun 27, 2025
6001432
Add TODO.
Feb 18, 2025
b9a78c2
Format code.
Mar 12, 2025
7742ddc
Merge branch 'master' into sbe-to-string
Jun 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ void generate(final Ir ir) throws IOException
indent(libRs, 0, "#![allow(clippy::all)]\n");
indent(libRs, 0, "#![allow(non_camel_case_types)]\n\n");
indent(libRs, 0, "#![allow(ambiguous_glob_reexports)]\n\n");
indent(libRs, 0, "#![allow(unused_mut)]\n\n");
indent(libRs, 0, "use ::core::{convert::TryInto};\n\n");

final ArrayList<String> modules = new ArrayList<>();
Expand Down Expand Up @@ -98,7 +99,7 @@ void generate(final Ir ir) throws IOException

generateEncoderTraits(libRs);
generateDecoderTraits(schemaVersionType, libRs);

generateSbeToString(libRs);
generateReadBuf(libRs, byteOrder);
generateWriteBuf(libRs, byteOrder);
}
Expand Down Expand Up @@ -132,6 +133,18 @@ static void generateDecoderTraits(final String schemaVersionType, final Writer w
indent(writer, 0, "}\n\n");
}

static void generateSbeToString(final Writer writer) throws IOException
{
indent(writer, 0, "/// Returns a human-readable string representation of the SBE message.\n");
indent(writer, 0, "///\n");
indent(writer, 0, "/// This trait works like `ToString`, but it takes `self` as value\n");
indent(writer, 0, "/// to be compatible with the generated decoders.\n");
indent(writer, 0, "pub trait SbeToString: Sized {\n");
indent(writer, 1, "/// Returns a human-readable string along with the consumed `self`.\n");
indent(writer, 1, "fn sbe_to_string(self) -> SbeResult<(Self, String)>;\n");
indent(writer, 0, "}\n\n");
}

static void generateSbeSchemaConsts(final Writer writer, final Ir ir) throws IOException
{
final String schemaIdType = rustTypeName(ir.headerStructure().schemaIdType());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ void generate(

indent(sb, 1, "}\n\n"); // impl end

if (codecType == Decoder)
{
RustGenerator.appendImplSbeToStringForDecoder(sb, msgTypeName, msgToken.name(), fields, groups, varData,
1);
}

// append all subGroup generated code
for (final SubGroup subGroup : subGroups)
{
Expand Down
Loading
Loading