easyofd_core/model/
bookmarks.rs1use crate::model::bookmark::Bookmark;
6
7#[derive(Debug, Clone, PartialEq)]
11pub struct Bookmarks {
12 pub items: Vec<Bookmark>,
14}
15
16impl Bookmarks {
17 pub fn new() -> Self {
19 Self { items: Vec::new() }
20 }
21
22 pub fn push(&mut self, bookmark: Bookmark) {
24 self.items.push(bookmark);
25 }
26
27 #[must_use]
29 pub fn len(&self) -> usize {
30 self.items.len()
31 }
32
33 #[must_use]
35 pub fn is_empty(&self) -> bool {
36 self.items.is_empty()
37 }
38}
39
40impl Default for Bookmarks {
41 fn default() -> Self {
42 Self::new()
43 }
44}