-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: Return number of bytes written for every operation #11
feat: Return number of bytes written for every operation #11
Conversation
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.
nice
sigh wasm builds are broken |
Is that on me? I saw there's some failures due to 1.63 being the MSRV, not 1.60 anymore. I pushed a commit that pushes the MSRV to 1.63. |
wasn’t you, lets see if your fix helps |
Ah I vaguely remembered seeing something related recently in rs-ucan. Followed the traces back and found this: Similar changes will probably fix this here, too. Let me commit them real quick. |
I think this should be ready to merge ✌️ |
I ran CI on my fork, it's running through fine there. I swear I'm done done for good now. |
🎉 |
published in |
The main change is to return
usize
fromCarWriter::write
andCarWriter::write_header
. Theseusize
s indicate the amount of bytes written to the underlyingAsyncWrite
.Knowing these numbers is useful to us (at fission), since it allows us to package up car files "until at least X bytes were written into the CAR file".
I added a proptest to make sure that the final CAR file is just as big as all the returned
usize
s summed up. (I initially messed up the impl.proptest
makes stuff like this easy to fix though.)