-
Notifications
You must be signed in to change notification settings - Fork 546
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
Rust: ConnectionEvent enum #4786
base: main
Are you sure you want to change the base?
Rust: ConnectionEvent enum #4786
Conversation
@@ -0,0 +1,178 @@ | |||
use std::ffi::c_void; |
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.
Add copyright.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4786 +/- ##
==========================================
- Coverage 87.38% 86.06% -1.33%
==========================================
Files 56 56
Lines 17400 17400
==========================================
- Hits 15205 14975 -230
- Misses 2195 2425 +230 ☔ View full report in Codecov by Sentry. |
@@ -85,6 +85,19 @@ impl core::fmt::Display for StatusCode { | |||
} | |||
} | |||
|
|||
impl StatusCode { | |||
/// If the ffi status is unknown/undefined, use not_supported by default. | |||
/// MsQuic returns an undefined status code should not happen ideally, |
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.
MsQuic absolutely can return other stays codes from the platform. I think we need a better solution for that.
Description
Provide a safe ConnectionEvent enum implementation. Added code to convert from ffi ConectionEvent union.
Added StatusCode::from_raw_lossy().
Removed manual ffi code for ConnectionEvent.
Added StreamRef as an none-owning handle wrapper used in ConnectionEvent.
Testing
Changed the existing test to use the new ConnectionEvent enum.
Documentation
NA