Skip to content

Rust Plugin Bindings: Bytes#1775

Merged
dOrgJelli merged 2 commits intoorigin-devfrom
namesty/byte-bindings
Jun 15, 2023
Merged

Rust Plugin Bindings: Bytes#1775
dOrgJelli merged 2 commits intoorigin-devfrom
namesty/byte-bindings

Conversation

@namesty
Copy link
Collaborator

@namesty namesty commented May 30, 2023

Needed for polywrap/rust-wrap-client#59

In Rust, bytes and an array of uint8 are not different types, they're all just Vec<u8>. But in the msgpack specification, they are indeed different (see bin family). Therefore, when deserializing a bin msgpack type and trying to coerce it to Vec<u8>, a mismatch error gets thrown (3Hren/msgpack-rust#249).

This PR adds annotations to use serde_bytes serialization/deserialization as recommended in the rmp_serde issue thread.

@dOrgJelli dOrgJelli merged commit 1a46cb7 into origin-dev Jun 15, 2023
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.

3 participants