Commit f076d6d
authored
feat: add back gc protect callback (#94)
## Description
This adds back a way to externally protect blobs from garbage
collection. It works like it did in blobs1: Users can provide an (async)
callback to which a `&mut HashSet<Hash>` is passed. The callback is
invoked before each gc run, and all hashes added to the set will be
protected from gc during this run.
Used in n0-computer/iroh-docs#47
## Breaking Changes
<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->
## Notes & open questions
<!-- Any notes, remarks or open questions you have to make about the PR.
-->
## 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 e188e9d commit f076d6d
2 files changed
+58
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
134 | 135 | | |
| 136 | + | |
135 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
136 | 150 | | |
137 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
138 | 176 | | |
| 177 | + | |
139 | 178 | | |
140 | | - | |
141 | 179 | | |
142 | 180 | | |
143 | 181 | | |
| |||
155 | 193 | | |
156 | 194 | | |
157 | 195 | | |
| 196 | + | |
158 | 197 | | |
159 | 198 | | |
160 | 199 | | |
| |||
172 | 211 | | |
173 | 212 | | |
174 | 213 | | |
| 214 | + | |
175 | 215 | | |
176 | 216 | | |
177 | 217 | | |
178 | 218 | | |
179 | 219 | | |
| 220 | + | |
180 | 221 | | |
181 | 222 | | |
| 223 | + | |
182 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
183 | 234 | | |
184 | 235 | | |
185 | 236 | | |
| |||
288 | 339 | | |
289 | 340 | | |
290 | 341 | | |
| 342 | + | |
291 | 343 | | |
292 | 344 | | |
293 | 345 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
0 commit comments