pub fn iter_mut(&mut self) -> IterMut<'_, K, V> {
        if let Some(root) = self.root.as_mut() {
            let first_entry = unsafe { ptr::read(&root) }.borrow_mut().first_entry();
            let last_entry = root.borrow_mut().last_entry(false);
            IterMut {
                imp: search::IterImpl::new(first_entry, last_entry),
                rem: self.len,
            }
        } else {
            IterMut {
                imp: search::IterImpl::none(),
                rem: 0,
            }
        }
    }
/// Returns a mutable iterator over the elements of the map, sorted by key.
///
/// # Examples
///
/// ```
/// use bptree::BpTreeMap;
///
/// let mut map = BpTreeMap::from([(3, "Three"), (1, "One"), (4, "Four"), (2, "Two")]);
///
/// let first_kv = map.iter_mut().next().unwrap();
/// assert_eq!(first_kv, (&1, &mut "One"));
/// *first_kv.1 = "Another";
/// drop(first_kv);
///
/// for (key, value) in map.iter_mut() {
///     println!("{}: {}", key, value);
/// }
/// ```
Returns a mutable iterator over the elements of the map, sorted by key.
Returns a mutable iterator over the elements of the map sorted by key .
pub fn iter_mut(&mut self) -> IterMut<'_, K, V> {
        if let Some(root) = self.root.as_mut() {
            let first_entry = unsafe { ptr::read(&root) }.borrow_mut().first_entry();
            let last_entry = root.borrow_mut().last_entry(false);
            IterMut {
                imp: search::IterImpl::new(first_entry, last_entry),
                rem: self.len,
            }
        } else {
            IterMut {
                imp: search::IterImpl::none(),
                rem: 0,
            }
        }
    }
pub fn iter_mut ( & mut self ) -> IterMut < ' _ , K , V > { if let Some ( root ) = self . root . as_mut ( ) { let first_entry = unsafe { ptr :: read ( & root ) } . borrow_mut ( ) . first_entry ( ) ; let last_entry = root . borrow_mut ( ) . last_entry ( false ) ; IterMut { imp : search :: IterImpl :: new ( first_entry , last_entry ) , rem : self . len , } } else { IterMut { imp : search :: IterImpl :: none ( ) , rem : 0 , } } }
Returns a mutable iterator over the elements of the map, sorted by key.
Returns a mutable iterator over the elements of the map sorted by key .
&mut self
&mut self
examples
```
use bptree::BpTreeMap.



let first_kv = map.iter_mut().next().unwrap();
assert_eq!(first_kv, (&1, &mut "One"));
first_kv.1 = "Another";
drop(first_kv).


` ` ` use bptree :: BpTreeMap . let first_kv = map . iter_mut () . next () . unwrap () ; assert_eq! ( first_kv ( &1 &mut " One " )) ; first_kv . 1 = " Another " ; drop ( first_kv ) .