Closed nyovaya closed 2 years ago
Please see #25.
The Deserialize trait's associated function does not take a self
, so there is no thing to box or turn into a trait object prior to the deserialization being performed. And after something has been deserialized, turning it into a dyn deserialize is useless because all the deserializing has already been completed.
@dtolnay Do you have an example for deserialization, like within a struct?
This will fail for me, do I need to manually implement something or is there something missing yet?
`#[derive(Serialize, Deserialize)] struct Foo{ bar: A }
[derive(Serialize, Deserialize)]
struct A(HashMap<String, Box>);
[derive(Serialize, Deserialize)]
struct B{ field: u32 }
pub trait Bar: erased_serde::Serialize + Any{
}
erased_serde::serialize_trait_object!(Bar);
impl Bar for B{
}`