pub struct ElementType(_);
Expand description

ElementType is an abstraction over element types in the specification.

It provides no public fields, but it has methods to get all the info needed to parse an arxml element.

Implementations

get the version mask of a sub element

get the multiplicity of a sub element within the current ElementType

The sub element is identified by an indx list, as returned by find_sub_element()

get the ContentMode of the container of a sub element of the current ElementType

The sub element is identified by an index list, as returned by find_sub_element()

find a sub element in the specification of the current ElementType

Note: Version here is NOT an AutosarVersion, it is a u32. it is a bitmask which can contain multiple AutosarVersions, or any version by using u32::MAX

In almost all cases this is simple: there is a flat list of sub elements that either contains the target_name or not. The result in those simple cases is a vec with one entry which is the index of the element in the list. There are a handfull of complicated situations though, where the list of sub elements contains groups of elements that have a different ContentMode than the other elements.

For example:

    PRM-CHAR (Sequence)
     -> Element: COND
     -> Group (Choice)
        -> Group (Sequence)
            -> Group (Choice)
                -> Group (Sequence)
                    -> Element: ABS
                    -> Element: TOL
                -> Group (Sequence)
                    -> Element: MIN
                    -> Element: TYP
                    -> Element: MAX
            -> Element: PRM-UNIT
        -> Element: TEXT
     -> Element: REMARK

When searching for TOL in PRM-CHAR, the result should be Some(vec![1, 0, 0, 0, 1])!

find the commmon group of two subelements of the current ElementType

The subelements are identified by their index lists, returned by find_sub_element().

In simple cases without sub-groups of elements, the “common group” is simply the current ElementType.

are elements of this ElementType named in any Autosar version

are elements of this elementType named in the given Autosar version

Named elements must have a SHORT-NAME sub element. For some elements this depends on the Autosar version.

One example of this is END-2-END-METHOD-PROTECTION-PROPS, which was first defined in Autosar_00048, but only has a name in Autosar_00050.

is the ElementType a reference

get the content mode for this ElementType

get the character data spec for this ElementType

find the spec for a single attribute by name

create an iterator over all attribute definitions in the current ElementType

create an iterator over all sub elements of the current ElementType

ElementType::ROOT is the root ElementType of the Autosar arxml document, i.e. this is the ElementType of the AUTOSAR element

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.