RefCell supports a single
RefMut to exist a time. That
RefMut can be converted using a
map method from a
RefMut<T> to a
RefMut<U>. However, slices can be split using the
split_at_mut methods. There is no equivalent way to split a
RefCell track a mutable count as well as an immutable count. The
RefCell would be considered mutably borrowed if the mutable count was nonzero.
RefMut could then provide a
split method with a signature like
fn split<U, F: Fn(&mut T) -> (&mut U, &mut U)>(self, f: F) -> (RefMut<U>, RefMut<U>), and would thus provide the
RefCell analog of splitting slices or other referenced objects.