Skip to content

Nesting custom serialization types and generic implementations #237

Answered by jonasbb
Lehona asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Lehona,

I am confused what exactly your code does, since you seem to be using different definitions throughout your message and not all code is posted.

Correct me if I'm wrong. I think you want to define a custom serialize/deserialize implementation for the PyDict type which allows you to change how the key/value are converted. So similar to how HashMap and BTreeMap work but for PyDict?

The definition for these two is this macro

macro_rules! map_impl {
($ty:ident < K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound:ident)* >) => {
impl<K, KU, V, VU $(, $typaram)*> SerializeAs<$ty<K, V $(,…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Lehona
Comment options

You must be logged in to vote
1 reply
@jonasbb
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants