Expand description
@kwannoel:
This module implements Serde for the Pretty struct. Why not implement it directly on our plan nodes?
That’s because Pretty already summarizes the fields that are important to us.
You can see that when explain()
is called, we directly return the Pretty
struct.
The proper way to do this would be to create a new data structure that plan nodes get converted into,
and then implement Serialize
and Deserialize
on that data structure (including to Pretty
).
But that’s a lot of refactoring work.
So we just wrap Pretty
in a newtype and implement Serialize
on that,
since it’s a good enough intermediate representation.