IndexBuffer: add clear()
This commit is contained in:
parent
8153da2091
commit
c41f6937ca
2 changed files with 6 additions and 1 deletions
|
@ -110,6 +110,11 @@ where
|
||||||
self.data.write().unwrap().remove(&key);
|
self.data.write().unwrap().remove(&key);
|
||||||
self.port.notify(&IndexArea::Set(vec![key]));
|
self.port.notify(&IndexArea::Set(vec![key]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn clear(&mut self) {
|
||||||
|
self.data.write().unwrap().clear();
|
||||||
|
self.port.notify(&IndexArea::Set(self.data.read().unwrap().keys().cloned().collect()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
|
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
|
||||||
|
|
|
@ -9,7 +9,7 @@ use {
|
||||||
|
|
||||||
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
|
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum IndexArea<Key> {
|
pub enum IndexArea<Key> {
|
||||||
Empty,
|
Empty,
|
||||||
Full,
|
Full,
|
||||||
|
|
Loading…
Reference in a new issue