Get the list as a mutable slice.
(&'a mut self, pool: &'a mut ListPool<T>)
| 334 | |
| 335 | /// Get the list as a mutable slice. |
| 336 | pub fn as_mut_slice<'a>(&'a mut self, pool: &'a mut ListPool<T>) -> &'a mut [T] { |
| 337 | let idx = self.index as usize; |
| 338 | match pool.len_of(self) { |
| 339 | None => &mut [], |
| 340 | Some(len) => &mut pool.data[idx..idx + len], |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | /// Get a mutable reference to a single element from the list. |
| 345 | pub fn get_mut<'a>(&'a mut self, index: usize, pool: &'a mut ListPool<T>) -> Option<&'a mut T> { |