Implement State::get in pane_grid

This commit is contained in:
Héctor Ramón Jiménez 2020-05-09 00:28:31 +02:00
parent f3d54a0f33
commit c620e4dc4c

View File

@ -82,6 +82,14 @@ impl<T> State<T> {
/// Returns the internal state of the given [`Pane`], if it exists.
///
/// [`Pane`]: struct.Pane.html
pub fn get(&self, pane: &Pane) -> Option<&T> {
self.panes.get(pane)
}
/// Returns the internal state of the given [`Pane`] with mutability, if it
/// exists.
///
/// [`Pane`]: struct.Pane.html
pub fn get_mut(&mut self, pane: &Pane) -> Option<&mut T> {
self.panes.get_mut(pane)
}