Rust::com Field and Method Rust Design and Example of APIs usage - #818
Open
bharatGoswami8 wants to merge 27 commits into
Open
Rust::com Field and Method Rust Design and Example of APIs usage#818bharatGoswami8 wants to merge 27 commits into
bharatGoswami8 wants to merge 27 commits into
Conversation
* Created Method related interface traits * Updated Interface macro * created method related macro
* For generating type state pattern for method and field * Validating offer API call
* Added impl block for method interface
* Added impl block for method interface traits
* Updated import score_com crate
* Added method api usage in example app
* Updated concept crate documentation * Updated interface macro document * Update type state macro document
* Updated return value to MethodReturnSample
* Added design markdown file and diagrams
* Added MethodReturnSample for returning value at consumer side * MethodInArgPtr trait added for argument type
* Created field interface APIs * Updated SampleMut to use in field as well
* Lola Runtime placeholder implementaion for field producer and consumer * Mock Runtime placeholder implementation
* Create proc macro for field init and set handler validation before offer call
* Updated example file with Field APIs usage
* Method and field both code generation added on macros
- Combined Field APIs design and example of usage from PR eclipse-score#700 - Combined Method Rust APIs design and Example usage from PR eclipse-score#777 - Resolved merge conflicts keeping both Field and Method additions
* Removed the separate set-get method and introduced field method using Method interface
* Added Getter, Setter, Notifier tag for field feature to enable
* Create separate file for Producer and Consumer interface macro
* Updated set and get APIs for registration
* Updated tags for field to generate the field specific methods * Updated intefrca macro as well
* Created trait level document design * document for field desing
bharatGoswami8
requested review from
LittleHuba,
castler,
crimson11 and
hoe-jo
as code owners
July 31, 2026 09:03
This was referenced Jul 31, 2026
bharatGoswami8
force-pushed
the
Rust_Field_and_Method_APIs
branch
from
July 31, 2026 10:12
c5cf7de to
0920265
Compare
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.
For Method and Field Design following things added -
Field subscribe/receive (
FieldSubscriber,FieldSubscriptiontraits): a consumer can subscribe to a field, receive value updates.Field publish/update (
FieldPublishertrait): a producer canupdate()a field value, register asethandler (called when a consumer sets the field), and register agethandler.Field get/set on the consumer side reuse Method infrastructure:
get_{name}()/set_{name}()async helpers are generated by theinterface!macro usingMethodCallerthere is no separate field-get/set trait.Method traits (
MethodHandlerfor producer,MethodCallerfor consumer): supports up to 8 arguments via tuple-based arities, with both copy and zero-copy call paths.Type-state derive macro (
#[derive(TypeStateValidator)]): generates compile-time state transitions so a producer struct cannot calloffer()before all fields are initialized and all handlers are registered.Interface macros split into producer and consumer:
interface_producer_macros.rsgenerates the skeleton struct with all fields/methods/events;interface_consumer_macros.rsgenerates the proxy struct.Runtime stub added to build the APIs example usage.
Example app with field_producer.rs,
field_consumer.rs,method_producer.rs,method_consumer.rsmodules showing the API usage end-to-end.Design documents and diagrams for both Field and Method architecture added.
#579