(&self, mut position: EntryIndex)
| 603 | } |
| 604 | |
| 605 | pub fn prev_entry(&self, mut position: EntryIndex) -> Option<(usize, PyObjectRef, T)> { |
| 606 | let inner = self.read(); |
| 607 | loop { |
| 608 | let entry = inner.entries.get(position)?; |
| 609 | position = position.saturating_sub(1); |
| 610 | if let Some(entry) = entry { |
| 611 | break Some((position, entry.key.clone(), entry.value.clone())); |
| 612 | } |
| 613 | } |
| 614 | } |
| 615 | |
| 616 | pub fn len_from_entry_index(&self, position: EntryIndex) -> usize { |
| 617 | self.read().entries.len().saturating_sub(position) |