Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From bndpresbufq-0.1.2 To bndpresbufq-0.1.3
2024-10-05
| ||
18:21 | Bugfix: Update the total queue size when try_return() is successful. check-in: 40a762cf04 user: jan tags: trunk | |
01:53 | Release maintenance. check-in: 789a8bbe7d user: jan tags: bndpresbufq-0.1.3, trunk | |
01:51 | Add try_return. check-in: 57133b16db user: jan tags: trunk | |
2024-09-12
| ||
23:06 | Release maintenance. check-in: 31bb13f5e5 user: jan tags: bndpresbufq-0.1.2, trunk | |
23:04 | Add clean() and is_full() functions. check-in: 8607dde02e user: jan tags: trunk | |
Changes to Cargo.toml.
1 2 | 1 2 3 4 5 6 7 8 9 10 | - + | [package] name = "bndpresbufq" |
︙ | |||
19 20 21 22 23 24 25 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | - + | ] # https://doc.rust-lang.org/cargo/reference/manifest.html#the-badges-section [badges] maintenance = { status = "passively-maintained" } [dependencies] |
Changes to src/lib.rs.
︙ | |||
190 191 192 193 194 195 196 197 198 199 200 201 202 203 | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | // At this point, pushing should always succeed self.q.force_push(n); self.size += nlen; Ok(()) } /// Attempt to put a buffer back on to the queue so that it will be the next /// one to be pulled off it. /// /// Intended to put a buffer back on the queue that was just taken off the /// queue but can not currently be processed. /// /// # Errors /// If the buffer would exceed the queues limits the buffer is returned. pub fn try_return(&mut self, n: Vec<u8>) -> Result<(), Vec<u8>> { let nlen = n.len(); // If a maximum size has been set for this queue .. if let Some(max_size) = self.max_size { // .. then bail if the input buffer size is larger than the maximum // allowed total queue size. if nlen > max_size { return Err(n); } // Make sure this node wouldn't exceed queue total capacity if self.size + nlen > max_size { return Err(n); } } self.size += nlen; self.q.try_return(n) } /// Take next buffer off queue. #[inline] pub fn pop(&mut self) -> Option<Vec<u8>> { let n = self.q.pop()?; self.size -= n.len(); Some(n) |
︙ |
Changes to www/changelog.md.
1 2 3 4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | - + + + + + + + + + + + + | # Change Log ## [Unreleased] |
︙ |