-
Notifications
You must be signed in to change notification settings - Fork 86
Rust::com Field APIs design for rust com library #638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
bharatGoswami8
wants to merge
13
commits into
eclipse-score:main
from
bharatGoswami8:field_API_design_Rust
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1117a9f
Rust::com Field Initial Design Plan
bharatGoswami8 c9b8388
Rust::com Field APIs design in rust com library
bharatGoswami8 210862b
Rust::com Update Producer Example
bharatGoswami8 3ea5101
Rust::com Consumer API example update
bharatGoswami8 5d851e1
Rust::com Mock Runtime update with same APIs
bharatGoswami8 f27f3cb
Rust::com Resolve the build issue
bharatGoswami8 7779473
Rust::com Updated async call in example
bharatGoswami8 bb63b71
Rust::com Update APIs parameter
bharatGoswami8 526eb41
Rust::com Intial value update for field
bharatGoswami8 6dc14b7
Rust::com Taking callback form user for Set Handler
bharatGoswami8 8d3921a
Rust::com Macro based Complie time check for field
bharatGoswami8 558674c
Rust::com added field get set method on subscription trait
bharatGoswami8 0dd4b02
Rust::com Updated async set method for Field
bharatGoswami8 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,16 +11,16 @@ | |
| * SPDX-License-Identifier: Apache-2.0 | ||
| ********************************************************************************/ | ||
|
|
||
| use com_api::{interface, CommData, ProviderInfo, Publisher, Reloc, Subscriber}; | ||
| use com_api::{interface, CommData, FieldPublisher, ProviderInfo, Publisher, Reloc, Subscriber}; | ||
|
|
||
| #[derive(Debug, Reloc, CommData)] | ||
| #[derive(Debug, Clone, Default, Reloc, CommData)] | ||
| #[repr(C)] | ||
| #[comm_data(id = "Tire")] | ||
| pub struct Tire { | ||
| pub pressure: f32, | ||
| } | ||
|
|
||
| #[derive(Debug, Reloc, CommData)] | ||
| #[derive(Debug, Clone, Default, Reloc, CommData)] | ||
| #[repr(C)] | ||
| // No explicit ID provided, so it will be auto-generated as "com_api_gen::Exhaust" | ||
| pub struct Exhaust {} | ||
|
|
@@ -39,10 +39,22 @@ pub struct Exhaust {} | |
| // "exhaust" events. | ||
| // - VehicleOfferedProducer<R> struct that implements OfferedProducer trait for offering | ||
| // "left_tire" and "exhaust" events. | ||
| //Let's remove | ||
| interface!( | ||
| interface Vehicle, { | ||
| Id = "VehicleInterface", | ||
| left_tire: Event<Tire>, | ||
| exhaust: Event<Exhaust>, | ||
| } | ||
| ); | ||
|
|
||
| // Field-based interface with compile-time initialization safety. | ||
| // All fields must be explicitly initialized via the validator pattern before offering. | ||
| // The validator pattern ensures that you cannot call offer() until all fields have been updated. | ||
| interface!( | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need thread pool count for each field which can be part of macro. left_tire : Field<Tire, Count> |
||
| interface VehicleField, { | ||
| Id = "VehicleFieldInterface", | ||
| left_tire: Field<Tire>, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. left_tire : Field<Tire, Initial_value, NotifyOnSet> |
||
| exhaust: Field<Exhaust>, | ||
| } | ||
| ); | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
macro need to be optimize.