-
Notifications
You must be signed in to change notification settings - Fork 0
Fix generics and frame handling #113
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
leynos
merged 2 commits into
codex/define-framemetadata-trait-and-update-functionality
from
codex/fix-type-parameter-errors-in-wireframeapp
Jun 22, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 |
|---|---|---|
|
|
@@ -42,9 +42,14 @@ pub fn processor() -> LengthPrefixedProcessor { | |
| /// | ||
| /// Returns any I/O errors encountered while interacting with the in-memory | ||
| /// duplex stream. | ||
| pub async fn run_app_with_frame<S>(app: WireframeApp<S>, frame: Vec<u8>) -> io::Result<Vec<u8>> | ||
| pub async fn run_app_with_frame<S, C, E>( | ||
| app: WireframeApp<S, C, E>, | ||
| frame: Vec<u8>, | ||
|
Comment on lines
+45
to
+47
Contributor
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. suggestion (testing): Consider adding or updating tests that use these helpers to exercise the new generic parameters. Ensure there are tests using the helpers with various C and E types to validate the generic logic and constraints. |
||
| ) -> io::Result<Vec<u8>> | ||
| where | ||
| S: TestSerializer, | ||
| C: Send + 'static, | ||
| E: Packet, | ||
| { | ||
| run_app_with_frame_with_capacity(app, frame, DEFAULT_CAPACITY).await | ||
| } | ||
|
|
@@ -58,13 +63,15 @@ where | |
| /// # Panics | ||
| /// | ||
| /// Panics if the spawned task running the application panics. | ||
| pub async fn run_app_with_frame_with_capacity<S>( | ||
| app: WireframeApp<S>, | ||
| pub async fn run_app_with_frame_with_capacity<S, C, E>( | ||
| app: WireframeApp<S, C, E>, | ||
| frame: Vec<u8>, | ||
| capacity: usize, | ||
| ) -> io::Result<Vec<u8>> | ||
| where | ||
| S: TestSerializer, | ||
| C: Send + 'static, | ||
| E: Packet, | ||
| { | ||
| run_app_with_frames_with_capacity(app, vec![frame], capacity).await | ||
| } | ||
|
|
@@ -76,12 +83,14 @@ where | |
| /// Returns any I/O errors encountered while interacting with the in-memory | ||
| /// duplex stream. | ||
| #[allow(dead_code)] | ||
| pub async fn run_app_with_frames<S>( | ||
| app: WireframeApp<S>, | ||
| pub async fn run_app_with_frames<S, C, E>( | ||
| app: WireframeApp<S, C, E>, | ||
| frames: Vec<Vec<u8>>, | ||
| ) -> io::Result<Vec<u8>> | ||
| where | ||
| S: TestSerializer, | ||
| C: Send + 'static, | ||
| E: Packet, | ||
| { | ||
| run_app_with_frames_with_capacity(app, frames, DEFAULT_CAPACITY).await | ||
| } | ||
|
|
@@ -95,13 +104,15 @@ where | |
| /// # Panics | ||
| /// | ||
| /// Panics if the spawned task running the application panics. | ||
| pub async fn run_app_with_frames_with_capacity<S>( | ||
| app: WireframeApp<S>, | ||
| pub async fn run_app_with_frames_with_capacity<S, C, E>( | ||
| app: WireframeApp<S, C, E>, | ||
| frames: Vec<Vec<u8>>, | ||
| capacity: usize, | ||
| ) -> io::Result<Vec<u8>> | ||
| where | ||
| S: TestSerializer, | ||
| C: Send + 'static, | ||
| E: Packet, | ||
| { | ||
| let (mut client, server) = duplex(capacity); | ||
| let server_task = tokio::spawn(async move { | ||
|
|
||
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.
issue (review_instructions): Do not remove envelope handling logic without providing an equivalent replacement or justification.
The previous logic handled extracting the id and bytes from the envelope, routing the request, and sending a response or logging errors. The new code simply returns 'result' without any of this handling. This is a significant change in behavior and should be justified or replaced with equivalent logic to avoid breaking functionality.
Review instructions:
Path patterns:
**/*Instructions:
Create code-review comments for ALL issues. Avoid making general observations or non-specific feedback if at all possible.