-
Notifications
You must be signed in to change notification settings - Fork 595
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
Improve AcceptedAlert::write documentation, example usage #1868
Conversation
The `wr: &mut dyn io::Write` provided to `AcceptedAlert::write` may return from a short write without having written the entire alert contents. To avoid dropping the remaining data in this circumstance the caller should make sure to repeatedly call `AcceptedAlert::write` until it returns `Ok(0)` or an error.
576cc87
to
fe308c1
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1868 +/- ##
==========================================
- Coverage 95.49% 95.47% -0.03%
==========================================
Files 85 85
Lines 18585 18589 +4
==========================================
Hits 17747 17747
- Misses 838 842 +4 ☔ View full report in Codecov by Sentry. |
Benchmark resultsInstruction countsSignificant differencesThere are no significant instruction count differences Other differencesClick to expand
Wall-timeSignificant differencesThere are no significant wall-time differences Other differencesClick to expand
Additional informationCheckout details:
|
This is a convenient helper for blocking contexts where the caller simply wants to ensure all bytes are written in a single call.
The `AcceptedAlert::write` fn may return having only written some of the alert buffer. We could either repeatedly call `write` until it returns `Ok(0)` or an error, or use the new `write_all` fn. This commit does updates the acceptor example to do the latter.
fe308c1
to
842dbf8
Compare
Resolves #1867