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

Implement map data type. #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Implement map data type. #129

wants to merge 1 commit into from

Conversation

redstar
Copy link
Contributor

@redstar redstar commented Aug 27, 2017

The map data type has a special proto syntax.
The serialization of

map<key_type, value_type> map_field = N;

is backward compatible to

message MapFieldEntry {
  key_type key = 1;
  value_type value = 2;
}

repeated MapFieldEntry map_field = N;

The option [packed = true] is not allowed on map fields.

@redstar
Copy link
Contributor Author

redstar commented Aug 27, 2017

I still work on the serialization. My question is if the general design is welcomed or if there are better ideas.

The map data type has a special proto syntax.
The serialization of

    map<key_type, value_type> map_field = N;

is backward compatible to

    message MapFieldEntry {
      key_type key = 1;
      value_type value = 2;
    }

    repeated MapFieldEntry map_field = N;

The option `[packed = true]` is not allowed on map fields.
@msoucy
Copy link
Owner

msoucy commented May 31, 2019

I have been away from dlang for a while (basically since graduating college), but I took a look at your design and it seems like a good starting point. If you're still open to developing this, I can take a look once serialization is implemented.

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

Successfully merging this pull request may close these issues.

2 participants