dtolnay/typetag

How to change the values of structures?

makorne opened this issue · 1 comments

Hi! Thank you for your great crates!!!

But how to change the values of structures?
For example set: click.x = 15

    let click = Click { x: 10, y: 10 };
    let event = &click as &dyn WebEvent;
    let json = serde_json::to_string(event)?;
    println!("Click json: {}", json);
    let mut de: Box<dyn WebEvent> = serde_json::from_str(&json)?;
    de.inspect();
    de.x = 15;
       ^ unknown field

Thanks!!