Skip to content

Rust::com Interface declarative macro for com-api#159

Closed
bharatGoswami8 wants to merge 5 commits intoeclipse-score:mainfrom
bharatGoswami8:declarative_macro_for_interface
Closed

Rust::com Interface declarative macro for com-api#159
bharatGoswami8 wants to merge 5 commits intoeclipse-score:mainfrom
bharatGoswami8:declarative_macro_for_interface

Conversation

@bharatGoswami8
Copy link
Copy Markdown
Contributor

  • Enabled the interface and dependent type generation with macro for user

eclipse-score/score#2561

* Enabled the interface and dependent type generation with macro for user
Comment thread score/mw/com/impl/rust/com-api/com-api-concept-macros/BUILD Outdated
Comment thread score/mw/com/impl/rust/com-api/com-api-concept-macros/interface_macros.rs Outdated
Comment thread score/mw/com/impl/rust/com-api/com-api/com_api.rs Outdated
* Moved interface macro file from macro to concept crate
* Auto ID added with Module Path
* Created lib crate root for concept module
Copy link
Copy Markdown
Contributor

@pawelrutkaq pawelrutkaq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • doc tests

Comment thread score/mw/com/impl/rust/com-api/com-api-concept/lib.rs
Comment thread score/mw/com/impl/rust/com-api/com-api-concept/interface_macros.rs Outdated
* Added document test for interface macro
@bharatGoswami8 bharatGoswami8 force-pushed the declarative_macro_for_interface branch from fa1d2b7 to 4273929 Compare February 24, 2026 10:44
* validate the ID and type generated from macro
Comment thread score/mw/com/impl/rust/com-api/com-api-concept/interface_macros.rs Outdated
Comment thread score/mw/com/impl/rust/com-api/com-api-concept/interface_macros.rs
Comment thread score/mw/com/impl/rust/com-api/com-api-concept/interface_macros.rs Outdated
Comment thread score/mw/com/impl/rust/com-api/com-api-concept/interface_macros.rs Outdated
Comment thread score/mw/com/impl/rust/com-api/com-api-concept/interface_macros.rs Outdated
@bharatGoswami8
Copy link
Copy Markdown
Contributor Author

PR using paste crate which is in discussion whether we can use it or not with score-rust-infrastructure team.

Copy link
Copy Markdown
Contributor

@pawelrutkaq pawelrutkaq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me all fine except paste! crate usage as its not clear what to do with certificaiton of it,

@darkwisebear
Copy link
Copy Markdown
Contributor

I would suggest to accept the change as-is and open a ticket so that we keep track of this issue. If we know how to treat external crates in safety critical code, we can keep it as-is if it gets qualified, or remove it at some point and resort to a proc macro. Other options like forking paste or reimplement it just do not make sense to me.

Copy link
Copy Markdown
Contributor

@pawelrutkaq pawelrutkaq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@darkwisebear @bharatGoswami8 fine with the approach for me. Maybe in code just mark that usage for paste! The crate is still under evaluation for safety and may be changed.

@bharatGoswami8
Copy link
Copy Markdown
Contributor Author

@darkwisebear , @pawelrutkaq ,
Ticket created for same - #173

@bharatGoswami8
Copy link
Copy Markdown
Contributor Author

bharatGoswami8 commented Mar 12, 2026

@darkwisebear , @pawelrutkaq ,
Minor updated regarding Interface macro with custom id signature -

From -

interface!(
    interface Vehicle, "VehicleInterface", {
         left_tire: Event<Tire>,
        exhaust: Event<Exhaust>,
     }
}

to -

interface!(
    interface Vehicle, {
        Id = "VehicleInterface",
        left_tire: Event<Tire>,
        exhaust: Event<Exhaust>,
     }
  }

@bharatGoswami8
Copy link
Copy Markdown
Contributor Author

7ebb3e8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants