mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-18 09:04:21 +01:00
add Nip51SetCache helper methods
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -72,6 +72,18 @@ impl Nip51SetCache {
|
||||
pub fn iter(&self) -> impl IntoIterator<Item = &Nip51Set> {
|
||||
self.cached_notes.values()
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.cached_notes.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.cached_notes.is_empty()
|
||||
}
|
||||
|
||||
pub fn at_index(&self, index: usize) -> Option<&Nip51Set> {
|
||||
self.cached_notes.get_index(index).map(|(_, s)| s)
|
||||
}
|
||||
}
|
||||
|
||||
fn add(
|
||||
|
||||
Reference in New Issue
Block a user