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

Support message types that are self referential #586

Open
codyoss opened this issue Jan 3, 2025 · 0 comments
Open

Support message types that are self referential #586

codyoss opened this issue Jan 3, 2025 · 0 comments
Labels
sidekick Issues related to the code generator type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@codyoss
Copy link
Member

codyoss commented Jan 3, 2025

Rust does not like self-referential types, at least without indirection. We will need to Box types that are self referential as such. Example

message Node {
  Node next = 1;
  Node prev = 2;
  string val = 3;
}
pub struct Node {
  pub next: Option<Box<Node>>,
  pub prev: Option<Box<Node>>,
  pub val: String,
}
@coryan coryan added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. sidekick Issues related to the code generator labels Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sidekick Issues related to the code generator type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants