IDL Elements Reference
This page summarizes the main IDL elements implemented in this repository.
Modules
Syntax:
Purpose:
- group declarations
- participate in fully qualified names
- affect generated module or namespace structure in targets such as Rust and C++
Interfaces
Syntax:
Purpose:
- declare service operations
- drive HTTP, JSON-RPC, and plugin-oriented generation
See also:
Structs
Purpose:
- model named record types
- generate concrete target-language data types
Important notes:
- optional members are meaningful for Rust, TypeScript, HTTP, OpenAPI, and related generators
- Rust passthrough attributes can affect generated source
Unions
Purpose:
- model tagged alternatives
- generate target-specific tagged representations
Implementation note:
- Rust generation creates a discriminator plus payload model rather than a raw C union
Enums, bitmasks, and bitsets
Purpose:
- express constrained symbolic values
- generate target-language enum or flag structures
Typedefs
Purpose:
- create aliases over scalar, sequence, map, or array forms
Constants
Purpose:
- define compile-time constants emitted into generated code
Exceptions
Purpose:
- describe operation-level exceptional outcomes
- target support varies by generator
Attributes
Syntax:
Purpose:
- define getter/setter-like interface properties
- map to generated operations or stream watch APIs depending on the profile
Parameter directions
Supported direction markers:
inoutinout
Behavior:
- HTTP and JSON-RPC generators use direction to decide request-side and response-side shaping
- if omitted,
inis generally the default
Template types
sequence<T>
Purpose:
- ordered repeated values
- also used by stream profiles for stream item typing
map<K, V>
Purpose:
- associative values
- target support depends on generator
Arrays
Purpose:
- fixed-size dimensions attached through declarators
Scalars
Common scalar families:
- integers
- floating point
- booleans
- characters and strings
octetfixedany,object,valuebase
For deeper target mapping details, inspect:
xidlc/doc/idl2rust.mdxidlc/doc/idl2rust-jsonrpc.md
Practical lookup strategy
- language syntax: this page
- generator modifiers: Annotations
- compiler directives: Pragmas
- output selection: Targets