Struct espr::ast::InverseAttribute[][src]

pub struct InverseAttribute {
    pub name: AttributeDecl,
    pub dest: String,
    pub dest_aggregation: AggregationOption,
    pub attribute: String,
    pub attribute_prefix: Option<String>,
}
Expand description

Attribute of an inverse clause parsed by inverse_attr

From ISO 10303-11 document,

ENTITY door;
  handle : knob;                -- inverse relationship for this attribute
  hinges : SET [1:?] OF hinge;
END_ENTITY;

ENTITY knob;
...
INVERSE
  opens : door FOR handle;
(* ^      ^        ^
   |      |        attribute name used in the parent entity
   |      The entity which has `SELF` as attribute
   name of this inverse relationship *)
END_ENTITY;

This means

knobs can only exist if they are used in the role of handle in one instance of a door

Fields

name: AttributeDecl

Name of this inverse relationship

opens in above example

dest: String

The entity name which has SELF as an attribute

door in above example

dest_aggregation: AggregationOption

Used if SET or BAG for parent entity specification

attribute: String

The attribute name used in the parent entity

handle in above example

attribute_prefix: Option<String>

Prefix of the attribute, used if the attribute is a sub-attribute of dest entity

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.