Skip to main content

EdlDerive

Derive Macro EdlDerive 

Source
#[derive(EdlDerive)]
{
    // Attributes available to this derive:
    #[target_struct]
    #[target_enum]
    #[boxed_inner_target]
    #[boxed_target]
}
Expand description

Entry point for #[derive(EdlDerive)].

Supports:

  • #[target_struct(path::Type)] — specifies the corresponding target struct.
  • #[target_enum(path::Type)] — specifies the corresponding target enum.
  • #[boxed_inner_target] — applied to Generic type fields whose inner type is boxed in the target struct.
  • #[boxed_target] — applied to fields that are boxed in the target struct.

These annotations guide code generation for automatic conversions between EDL-defined Rust types and their generated target representations.

Example:

#[derive(EdlDerive)]
#[target_struct(GeneratedModule::FooT)]
pub struct Foo {
    #[boxed_inner_target]
    pub opt_nested_struct: Option<NestedStruct>,

    #[boxed_target]
    pub nested_struct: NestedStruct,

    pub flag: bool,
}