-
Notifications
You must be signed in to change notification settings - Fork 0
Introduce PacketParts and optional correlation IDs #282
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
36b86c1
Introduce PacketParts and optional correlation IDs
leynos 867338e
Document packet abstraction
leynos 88d54eb
Rename PacketParts field and expand correlation tests
leynos 7e87c81
Document PacketParts and expose response correlation setter
leynos 47e3dfe
Test PacketParts conversions and mismatched IDs
leynos 020adc9
Address review comments on correlation ID handling
leynos 2df1781
Encapsulate PacketParts and clarify correlation semantics
leynos 7325a74
Expose request correlation setter
leynos 6bda6e0
Document packet part privacy
leynos 1a94d00
Import PacketParts in doctest and use processor helper
leynos e7dc1a4
Link packet enum example and log mismatched ids
leynos 0cf6188
Mark Envelope fields private in class diagram
leynos c565a23
Clarify packet abstraction diagram
leynos 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # API overview | ||
|
|
||
| ## PacketParts | ||
|
|
||
| A `PacketParts` struct decomposes a packet into its components: | ||
|
|
||
| ```rust | ||
| let parts = PacketParts::new(id, correlation_id, payload); | ||
| ``` | ||
|
|
||
| - `id: u32` — frame identifier | ||
| - `correlation_id: Option<u64>` — `None` marks an unsolicited event or | ||
| server‑initiated push | ||
| - `payload: Vec<u8>` — raw message bytes | ||
|
|
||
| Custom packet types can convert to and from `PacketParts` to avoid manual | ||
| mapping: | ||
|
|
||
| ```rust | ||
| let parts = PacketParts::new(id, None, data); | ||
| let env = Envelope::from(parts); | ||
| ``` | ||
|
|
||
| `None` propagation ensures packets that originate on the server carry no | ||
| accidental correlation identifier. |
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
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.
Uh oh!
There was an error while loading. Please reload this page.