Module ruststep::ast [−][src]
Expand description
Abstract syntax tree for exchange structure
This module contains implementation of serde::Serialize and serde::Deserialize for AST structs.
Deserialize
Implementing a Deserializer page of serde manual says
The deserializer is responsible for mapping the input data into Serde’s data model by invoking exactly one of the methods on the Visitor that it receives.
serde::de::Deserializer trait is implemented for Parameter,
Record, and SubSuperRecord.
Be sure that this mapping is not only for espr-generated structs.
This can be used with other Rust structs using serde_derive::Deserialize
custom derive:
┌────────────────────┐
│ Exchange Structure │
└─┬──────────────────┘
│ Deserialier trait ◄── Implemented here
┌─▼────────────────┐
│ serde data model │
└─┬────┬───────────┘
│ │ ruststep_derive::Deserialize
│ ┌──▼─────────────────────────┐
│ │ espr-generated Rust struct │
│ └────────────────────────────┘
│ serde_derive::Deserialize
┌─▼─────────────────┐
│ Other Rust struct │
└───────────────────┘
Modules
Structs
DATA
section in STEP file
Entire exchange structure
A struct typed in EXPRESS schema, e.g. A(1.0, 2.0)
A set of Record mapping to complex entity instance,
e.g. (A(1) B(2.0) C("3"))
Enums
Each line of data section
Name of an entity instance or a value
Primitive value type in STEP data
Traits
AST portion