diff options
author | 2020-05-09 00:28:31 +0200 | |
---|---|---|
committer | 2020-05-22 21:55:45 +0200 | |
commit | c620e4dc4caaedf3ce74b14d95c1269eb7b1d535 (patch) | |
tree | aaa28eac34532cdfca839353e183504b53489560 /native | |
parent | f3d54a0f332c8da3aca3cc1b37e63cfa96d7a526 (diff) | |
download | iced-c620e4dc4caaedf3ce74b14d95c1269eb7b1d535.tar.gz iced-c620e4dc4caaedf3ce74b14d95c1269eb7b1d535.tar.bz2 iced-c620e4dc4caaedf3ce74b14d95c1269eb7b1d535.zip |
Implement `State::get` in `pane_grid`
Diffstat (limited to 'native')
-rw-r--r-- | native/src/widget/pane_grid/state.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/native/src/widget/pane_grid/state.rs b/native/src/widget/pane_grid/state.rs index 5cb41984..cca8fd4a 100644 --- a/native/src/widget/pane_grid/state.rs +++ b/native/src/widget/pane_grid/state.rs @@ -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) } |