Add get_selections to MultiListState

This commit is contained in:
Nicholas Howard 2021-09-02 13:45:51 -05:00
parent b4cc38f241
commit 7b3c8871f3

View file

@ -1,4 +1,4 @@
use std::collections::HashSet;
use std::{borrow::Borrow, collections::HashSet};
use super::{Block, ListItem, StatefulWidget, Widget};
use crate::{
@ -47,6 +47,10 @@ impl MultiListState {
pub fn get_highlight(&mut self) -> Option<usize> {
self.highlighted
}
pub fn get_selections(&self) -> &HashSet<usize> {
self.selected.borrow()
}
}
#[derive(Debug, Clone)]