Idiomatic way of returning multiple types in Rust [duplicate]
问题 This question already has an answer here : Multiple return types from a method (1 answer) Closed 4 months ago . I'm writing a program which parses a number of files. These files can fall into a number of different categories and I don't know which in advance. I makes sense to create a type for each type of data the files can contain, but I'm struggling with getting this datatype out of my parser and into my model/main program. In most other programming languages I would probably define a