How can deserialization of polymorphic trait objects be added in Rust if at all?

后端 未结 3 599
余生分开走
余生分开走 2020-12-01 21:05

I\'m trying to solve the problem of serializing and deserializing Box. I know that in the case of a closed type hierarchy, the recommended way

3条回答
  •  借酒劲吻你
    2020-12-01 21:57

    All your libraries could provide a registration routine, guarded by std::sync::Once, that register some identifier into a common static mut, but obviously your program must call them all.

    I've no idea if TypeId yields consistent values across recompiles with different dependencies.

提交回复
热议问题