Rust::com Interface declarative macro for com-api#159
Draft
bharatGoswami8 wants to merge 4 commits intoeclipse-score:mainfrom
Draft
Rust::com Interface declarative macro for com-api#159bharatGoswami8 wants to merge 4 commits intoeclipse-score:mainfrom
bharatGoswami8 wants to merge 4 commits intoeclipse-score:mainfrom
Conversation
* Enabled the interface and dependent type generation with macro for user
pawelrutkaq
requested changes
Feb 19, 2026
score/mw/com/impl/rust/com-api/com-api-concept-macros/interface_macros.rs
Outdated
Show resolved
Hide resolved
* Moved interface macro file from macro to concept crate * Auto ID added with Module Path * Created lib crate root for concept module
pawelrutkaq
requested changes
Feb 24, 2026
score/mw/com/impl/rust/com-api/com-api-concept/interface_macros.rs
Outdated
Show resolved
Hide resolved
* Added document test for interface macro
fa1d2b7 to
4273929
Compare
* validate the ID and type generated from macro
pawelrutkaq
reviewed
Feb 27, 2026
|
|
||
| #[doc(hidden)] | ||
| #[allow(unused_imports)] | ||
| pub use paste; |
Contributor
There was a problem hiding this comment.
no external deps please.
| let type_name_only = actual.split("::").last().unwrap_or(""); | ||
| let expected = "VehicleInterface"; | ||
| assert_eq!(type_name_only, expected, "Type name mismatch for VehicleInterface"); | ||
|
|
Contributor
There was a problem hiding this comment.
Everything above makes no sense or ? Using VehicleInterface tells you if a type has such name as you expected?
|
|
||
| //wrong id validation | ||
| let wrong_id = "SomeInterfaceID"; | ||
| assert_ne!(interface_id, wrong_id, "Interface ID should not match the wrong ID"); |
Contributor
There was a problem hiding this comment.
makse no sense or ? You are checking if PartialEq works for str ?
|
|
||
| //wrong type name validation | ||
| let wrong_type_name = "SomeInterface"; | ||
| assert_ne!(type_name_only, wrong_type_name, "Type name should not match the wrong type name"); |
Contributor
There was a problem hiding this comment.
repeated in below tests
|
|
||
| // Validate Producer with multiple event publishers | ||
| let producer_type = std::any::type_name::<MultiEventProducer<LolaRuntime>>(); | ||
| assert!(producer_type.contains("MultiEventProducer"), |
Contributor
There was a problem hiding this comment.
You dont need to compare. If yuo can reference type its is ok. And for such a tests, they are in doctest or becasue this will not compile if yuo change macro impl.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
eclipse-score/score#2561