Struct a2lfile::ModuleNameMap

source ·
pub struct ModuleNameMap<'a> {
    pub compu_method: HashMap<String, &'a CompuMethod>,
    pub compu_tab: HashMap<String, NameMapCompuTab<'a>>,
    pub frame: HashMap<String, &'a Frame>,
    pub function: HashMap<String, &'a Function>,
    pub group: HashMap<String, &'a Group>,
    pub memory_segment: HashMap<String, &'a MemorySegment>,
    pub object: HashMap<String, NameMapObject<'a>>,
    pub record_layout: HashMap<String, &'a RecordLayout>,
    pub transformer: HashMap<String, &'a Transformer>,
    pub typedef: HashMap<String, NameMapTypedef<'a>>,
    pub unit: HashMap<String, &'a Unit>,
    pub variant: HashMap<String, &'a VarCriterion>,
}
Expand description

ModuleNameMap collects references to all items with a Module into HashMaps, making it possible to access them all by name.

There are several name spaces per module, each stored in a different HashMap in the ModuleNameMap:

  • object: CHARACTERISTIC, MEASUREMENT, AXIS_PTS, BLOB, INSTANCE
  • compu_method: COMPU_METHOD
  • compu_tab: COMPU_VTAB, COMPU_VTAB_RANGE, COMPU_TAB
  • frame: FRAME
  • function: FUNCTION
  • group: GROUP
  • memory_segment: MEMORY_SEGMENT
  • record_layout: RECORD_LAYOUT
  • transformer: TRANSFORMER
  • typedef: TYPEDEF_AXIS, TYPEDEF_BLOB, TYPEDEF_CHARACTERISTIC, TYPEDEF_INSTANCE, TYPEDEF_MEASUREMENT
  • unit: UNIT
  • variant: VARIANT

While the ModuleNameMap is holding these references, the borrow checker will prevent any of these items from being modified.

Fields§

§compu_method: HashMap<String, &'a CompuMethod>§compu_tab: HashMap<String, NameMapCompuTab<'a>>§frame: HashMap<String, &'a Frame>§function: HashMap<String, &'a Function>§group: HashMap<String, &'a Group>§memory_segment: HashMap<String, &'a MemorySegment>§object: HashMap<String, NameMapObject<'a>>§record_layout: HashMap<String, &'a RecordLayout>§transformer: HashMap<String, &'a Transformer>§typedef: HashMap<String, NameMapTypedef<'a>>§unit: HashMap<String, &'a Unit>§variant: HashMap<String, &'a VarCriterion>

Implementations§

source§

impl<'a> ModuleNameMap<'a>

source

pub fn build(module: &'a Module, log_msgs: &mut Vec<String>) -> Self

build a new ModuleNameMap for the given Module

Trait Implementations§

source§

impl<'a> Debug for ModuleNameMap<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> PartialEq for ModuleNameMap<'a>

source§

fn eq(&self, other: &ModuleNameMap<'a>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> StructuralPartialEq for ModuleNameMap<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for ModuleNameMap<'a>

§

impl<'a> RefUnwindSafe for ModuleNameMap<'a>

§

impl<'a> Send for ModuleNameMap<'a>

§

impl<'a> Sync for ModuleNameMap<'a>

§

impl<'a> Unpin for ModuleNameMap<'a>

§

impl<'a> UnwindSafe for ModuleNameMap<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.