Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Difference From bndpresbufq-0.1.1 To bndpresbufq-0.1.2
2024-10-05
| ||
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 | |
22:02 | Release maintenance. check-in: 59354d4d2b user: jan tags: bndpresbufq-0.1.1, trunk | |
22:00 | Use limq 0.1.1. Make sure specific panic messages are used. Pedantic clippy. check-in: d00fa4a2e1 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.
︙ | |||
54 55 56 57 58 59 60 61 62 63 64 65 66 67 | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | + + + + + + + | ); Self { q: LimQ::new(max_len), max_size, size: 0 } } /// Clear all buffers from queue. #[inline] pub fn clear(&mut self) { self.q.clear(); self.size = 0; } /// Change the length limit of the queue. /// /// # Panics /// A zero-limit will cause a panic. pub fn set_max_len(&mut self, max_len: Option<usize>) { self.q.set_max_len(max_len); |
︙ | |||
107 108 109 110 111 112 113 114 115 116 117 118 119 120 | 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 | + + + + + + + + + + + + | /// Return boolean indicating whether the queue is empty or not. #[inline] #[must_use] pub fn is_empty(&self) -> bool { self.q.is_empty() } /// Return boolean indicating whether the queue has reached its configured /// limits. /// /// Returns `false` is no limits have been configured. #[must_use] pub fn is_full(&self) -> bool { self.q.is_full() || self .max_size .map_or(false, |max_size| self.size >= max_size) } /// Drop elements that overflow the queue limit (if a limit has been set). #[inline] pub fn purge_overflow(&mut self) { self.q.purge_overflow(); if let Some(max_size) = self.max_size { while self.size > max_size { |
︙ | |||
283 284 285 286 287 288 289 | 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | - - + + + + + + + + + + + + + + + + + + + + + + + + + + | } #[test] fn force_too_big_buf() { let mut q = BndPresLimBufQ::new(None, Some(2)); assert_eq!(q.force_push([1, 2, 3].into()), Err(vec![1, 2, 3])); } |
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 | - + + + + + + + + + + + | # Change Log ## [Unreleased] |
︙ |