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

Allow (un)packing structs containing Vec<T> with #[derive(MsgPacker)] #15

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aurelj
Copy link

@aurelj aurelj commented Dec 6, 2023

Currently the following code doesn't work:

#[derive(MsgPacker)]
pub struct A {
    b: Vec<u32>,
}

because Vec<T> doesn't implement Packable.

This PR changes the binary (un)packer to apply to a new MsgPackerBin wrapper type used to mark Vec<u8> that should be encoded as msgpack binary format.

This free the way to implement (Un)Packable for Vec<T> and thus allows Vec<T> to be packed as msgpack array format, fixing the above mentioned code.

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.

None yet

1 participant