Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.
This repository was archived by the owner on May 6, 2020. It is now read-only.

Preserve order while deserializing #26

@futile

Description

@futile

Assume the following xml:

<parent>
  <objA/>
  <objB/>
  <objA/>
</parent>

How can I deserialize this in a fashion that preserves the order 'objA' 'objB' 'objA'?

Deserializing into a Vec<ObjA> and a Vec<ObjB> would not preserve the information that the single ObjB was deserialized between the other two.

I guess in this case an enum like enum Obj { ObjA, ObjB}, and then a Vec<Obj> would make sense, but from what I saw in the tests this only works when the xml looks like <obj xsi:type="ObjA"> etc.

Is there a good way to do this (without deserializing the whole parent manually)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions