autosar-data-specification
This crate exists to support the autosar-data crate.
The Autosar data model is originally specified as .xsd files - one for each version of the standard. All these separate xsd files were parsed into data structures and combined; this crate contains the combined specification data of all 18 Autosar 4 standard revisions.
Supported standards
xsd filename | description |
---|---|
AUTOSAR_4-0-1.xsd | AUTOSAR 4.0.1 |
AUTOSAR_4-0-2.xsd | AUTOSAR 4.0.2 |
AUTOSAR_4-0-3.xsd | AUTOSAR 4.0.3 |
AUTOSAR_4-1-1.xsd | AUTOSAR 4.1.1 |
AUTOSAR_4-1-2.xsd | AUTOSAR 4.1.2 |
AUTOSAR_4-1-3.xsd | AUTOSAR 4.1.3 |
AUTOSAR_4-2-1.xsd | AUTOSAR 4.2.1 |
AUTOSAR_4-2-2.xsd | AUTOSAR 4.2.2 |
AUTOSAR_4-3-0.xsd | AUTOSAR 4.3.0 |
AUTOSAR_00042.xsd | AUTOSAR Adaptive 17-03 |
AUTOSAR_00043.xsd | AUTOSAR Adaptive 17-10 |
AUTOSAR_00044.xsd | AUTOSAR Classic 4.3.1 |
AUTOSAR_00045.xsd | AUTOSAR Adaptive 18-03 |
AUTOSAR_00046.xsd | AUTOSAR Classic 4.4.0 / Adaptive 18-10 |
AUTOSAR_00047.xsd | AUTOSAR Adaptive 19-03 |
AUTOSAR_00048.xsd | AUTOSAR 4.5.0 |
AUTOSAR_00049.xsd | AUTOSAR 4.6.0 |
AUTOSAR_00050.xsd | AUTOSAR 4.7.0 |
Since the raw data is rather opaque, it is not exposed directly, but rather there are functions to interact with it.
Using the crate
The main datatype is the ElementType
. The type of the <AUTOSAR>
element at the root of every arxml file is
available as ElementType::ROOT
.
Example
use *;
use FromStr;
let root_type = ROOT;
// parsing an element
let element_name_text = "AR-PACKAGES";
let element_name = from_str.unwrap;
assert_eq!;
let version_mask = Autosar_4_3_0 as u32;
if let Some = root_type.find_sub_element