(&mut self, command: Commands)
| 165 | self.explain = format!("{}{}", explain, "..."); |
| 166 | } |
| 167 | |
| 168 | pub(crate) fn set_offset(&mut self, offset: i32) { |
| 169 | let new_offset = (self.backlog_offset as i32 + offset).max(0); |
| 170 | // 不能超过最大可偏移量 |
| 171 | let max_offset = self.max_offset(); |
| 172 | self.backlog_offset = new_offset.min(max_offset as i32) as usize; |