-
Notifications
You must be signed in to change notification settings - Fork 104
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
Add FromBytes::read_from_io
and IntoBytes::write_to_io
#2016
base: v0.8.x
Are you sure you want to change the base?
Conversation
src/lib.rs
Outdated
@@ -4525,6 +4529,24 @@ pub unsafe trait FromBytes: FromZeros { | |||
} | |||
} | |||
|
|||
/// TODO |
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.
TODO: Doc comment
src/lib.rs
Outdated
@@ -5188,6 +5210,16 @@ pub unsafe trait IntoBytes { | |||
Ok(()) | |||
} | |||
|
|||
/// TODO |
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.
TODO: Doc comment
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.
TODO: Tests
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v0.8.x #2016 +/- ##
==========================================
+ Coverage 87.59% 87.64% +0.05%
==========================================
Files 16 16
Lines 5988 6016 +28
==========================================
+ Hits 5245 5273 +28
Misses 743 743 ☔ View full report in Codecov by Sentry. |
e4949fb
to
6367580
Compare
/// | ||
/// # Examples | ||
/// | ||
/// ```no_run |
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.
If you want this to run, you could use a trick like we do here:
Line 711 in ace5bb0
/// ```rust |
/// | ||
/// # Examples | ||
/// | ||
/// ```no_run |
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.
If you want this to run, you could use a trick like we do here:
Line 711 in ace5bb0
/// ```rust |
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.
I don't think there's much sense in actually testing the IO. It'll make our tests more expensive to run, and will cause them to fail on platforms where file IO is stubbed out (e.g., wasm).
/// This is a shorthand for `dst.write_all(self.as_bytes())`, and is useful | ||
/// for interfacing with operating system byte sinks (files, sockets, etc.). |
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.
Same here - IMO we should remove the mention of OS byte sinks.
Makes progress on #158. Co-authored-by: Joshua Liebow-Feeser <[email protected]>
Makes progress on #158.