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

Sequence and map types needed #607

Closed
diwic opened this issue Nov 4, 2016 · 2 comments
Closed

Sequence and map types needed #607

diwic opened this issue Nov 4, 2016 · 2 comments

Comments

@diwic
Copy link

diwic commented Nov 4, 2016

I'm looking into serde support for my D-Bus bindings, but quickly ran into problems with trying to Serialize an empty array.

D-Bus allows typing of arrays, i e, all elements must be the same type. I could take that type from the first element, if it weren't for the fact that arrays can be empty. So, if I receive a serialize_seq_fixed_size with a size of 0 (or a serialize_seq directly followed by a serialize_seq_end), I have no idea if I need to append an empty D-Bus array of i32s, &strs or something else.

Edit: The same applies to maps, which are also strongly typed.

@diwic diwic changed the title Sequence types needed Sequence and map types needed Nov 4, 2016
@oli-obk
Copy link
Member

oli-obk commented Nov 4, 2016

We could make serialize_seq generic over the type to be serialized, just like serialize_seq_elt. But we'd still need a way to use a Serialize type without an object. I think this is closely related to the tagging troubles we have with cbor

@diwic
Copy link
Author

diwic commented Nov 5, 2016

Yeah, given the current design of serde I'm not sure how to solve it either...

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

No branches or pull requests

3 participants