Expand description
A parser for the DSDL (Data structure description language) used in uavcan
For full description have a look at the specification
§Examples
§Parse DSDL directory
use dsdl_parser::DSDL;
assert!(DSDL::read("tests/dsdl/").is_ok());
§Parse single file
use dsdl_parser::DSDL;
assert!(DSDL::read("tests/dsdl/uavcan/protocol/341.NodeStatus.uavcan").is_ok());
§Display a file
use dsdl_parser::DSDL;
let dsdl = DSDL::read("./tests/dsdl/").unwrap();
println!("{}", dsdl.get_file("uavcan.protocol.GetNodeInfo").unwrap());
§Calculate data type signature
use dsdl_parser::DSDL;
let dsdl = DSDL::read("./tests/dsdl/").unwrap();
assert_eq!(dsdl.data_type_signature("uavcan.protocol.GetNodeInfo").unwrap(), 0xee468a8121c46a9e);
Structs§
- Comment
- A comment
- Composite
Type - A CompositeType is what the uavcan specification refers to as “Nested data structures”
- Const
Definition - A constant definition
- DSDL
- The
DSDL
struct contains a number of data type definition - Field
Definition - A Field definition
- File
- A DSDL file
- File
Name - Uniquely defines a DSDL file
- Ident
- An Identifier (name)
- Message
Definition - An Uavcan message definition
- Normalized
File - A normalized
File
- Service
Definition - An Uavcan service definition
- Size
- Used to determin size of e.g. DynamicArray or a StaticArray
- Version
- A dsdl file version
Enums§
- Array
Info - Uavcan array information
- Attribute
Definition - An attribute definition is either a
FieldDefintion
or aConstDefinition
- Cast
Mode - Cast mode defines the rules of conversion from the native value of a certain programming language to the serialized field value.
- Const
- A constant must be a primitive scalar type (i.e., arrays and nested data structures are not allowed as constant types).
- Directive
- An Uavcan Directive
- Line
- A
Line
in a DSDLFile
- Parse
Cast Mode Error - Parse
Directive Error - Parse
File Name Error - Parse
Primitive Type Error - Primitive
Type - An Uavcan
PrimitiveDataType
- Ty
- An Uavcan data type
- Type
Definition - A DSDL type definition.