Thanks. Adding the extra "child" parameters does work.
About the second part of the question, is it possible to have a data structure where I don't have a separate SubsystemsConfig
struct with a single subsystems
member? So lets say there was an overall config structure Config
struct Config
{
subsystems: Vec<SubsystemConfig>
params: SomeOtherParam,
... // other fields
}
and
<Config>
<Subsystems>
<EngineSubsystem> ... </EngineSubsystem>
<SensorSubsystem> ... </SensorSubsystem>
</Subsystems>
<SomeOtherParam> ... </SomeOtherParam>
</Config>
Thanks.
I have an XML file that is something like this:
<Subsystems>
<EngineSubsystem><!-- ... --></EngineSubsystem>
<SensorSubsystem><!-- ... --></SensorSubsystem>
<SomeOtherSubsystem><!-- ... --></SomeOtherSubsystem>
</Subsystems>
The corresponding struct has:
#[derive(Debug, Clone, XmlRead, PartialEq)]
pub enum SubsystemConfig {
#[xml(tag = "EngineSubsystem")]
EngineSubsystemConfig(EngineSubsystemConfig),
#[xml(tag = "SensorSubsystemConfig")]
SensorSubsystemConfig(SensorSubsystemConfig),
#[xml(tag = "SomeOtherSubsystem")]
SomeOtherSubsystem(SomeOtherSubsystem),
}
#[derive(Debug, Clone, XmlRead, PartialEq)]
pub struct SubsystemConfig {
#[xml(tag = "Subsystems")]
pub subsystems: Vec<SubsystemConfig>
}
This however does not work. Is there some other way of doing this?
Slightly unrelated question. For Vec
s in general, is it possible to have a data-structure like:
<Parent>
<Children>
<Child>1</Child>
<Child>2</Child>
<Child>3</Child>
</Children>
</Parent>
mapped to something like:
pub struct Parent {
children: Vec<Child>
}
Thomas Antony (a82281dc) at 02 Nov 03:51
Merge branch 'issue-233' into 'master'
... and 4 more commits
Thomas Antony (d21bcb95) at 27 Oct 04:48
Create issue templates
Thomas Antony (85986b55) at 28 Mar 21:12
Merge branch '230-monte-carlo-for-mission-design-improvements' into...
... and 14 more commits
Thomas Antony (85986b55) at 28 Mar 21:12
Thomas Antony (46bc379a) at 24 Mar 23:58
Merge branch '39-stablize-hyperdual-and-bump-nalgebra' into 'master'
... and 1 more commit
Thomas Antony (8f5769e6) at 24 Feb 00:47
Merge branch '231-switch-default-propagator-to-dormand-prince-78' i...
... and 4 more commits
Thomas Antony (6dadd63c) at 09 Feb 06:34
Merge branch '194-monte-carlo-manager' into 'master'
... and 7 more commits
Thomas Antony (0c4b94df) at 03 Feb 23:53
Merge branch '103-multi-oe-ruggiero-correction-broken-when-raan-inv...
... and 8 more commits
Thomas Antony (a8b28f29) at 27 Jan 21:29
Merge branch '223-guidance-law-development' into 'master'
... and 50 more commits
Confirmed that it works:
Thomas Antony (55082844) at 20 Jan 20:56
Add pyo3_log to send logs to Python
Thomas Antony (213db3be) at 20 Jan 20:54
Add pyo3_log to send logs to Python
Thomas Antony (ce08538c) at 20 Jan 20:50
Bump pyo3 version and add pyproject.toml
... and 6 more commits