Commit 8eb5733
authored
feat: Read and seek (#119)
## Description
Add an api for reading and seeking a blob using tokio::io::AsyncRead and
tokio::io::AsyncSeek
## Breaking Changes
Changes api::blobs::ExportRangesProgress::stream to be non-async - it
does not have to be!
## Notes & open questions
Note: the entire machinery of seek and read is horribly undocumented
regarding the non happy case. So I went with the following approach: if
you ever drop a future of either seek or read before completing, the
reader becomes poisioned and will never work again, you have to grab a
new one, which is cheap.
This bypasses the whole question about what to do if somebody calls x
without having completed y, and in normal usage you should never notice
this.
## Change checklist
- [ ] Self-review.
- [ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [ ] Tests if relevant.
- [ ] All breaking changes documented.1 parent 719cdb4 commit 8eb5733
5 files changed
+382
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
105 | 140 | | |
106 | 141 | | |
107 | 142 | | |
| |||
647 | 682 | | |
648 | 683 | | |
649 | 684 | | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
650 | 691 | | |
651 | 692 | | |
652 | 693 | | |
| |||
856 | 897 | | |
857 | 898 | | |
858 | 899 | | |
859 | | - | |
| 900 | + | |
860 | 901 | | |
861 | 902 | | |
862 | 903 | | |
| |||
0 commit comments