pub struct Bookmarks { /* private fields */ }Expand description
A persisted bookmark list. Every mutation saves immediately — the file is tiny and losing a bookmark to a crash would violate the “solid” tenet.
Implementations§
Source§impl Bookmarks
impl Bookmarks
Sourcepub fn load(path: impl Into<PathBuf>) -> Self
pub fn load(path: impl Into<PathBuf>) -> Self
Load from path (missing or unreadable → empty list, never an error).
Sourcepub fn default_path() -> PathBuf
pub fn default_path() -> PathBuf
The default per-user store: ~/.config/infinite/bookmarks.json (or the
platform equivalent via XDG_CONFIG_HOME), falling back to the current
directory when no home is known.
pub fn entries(&self) -> &[Bookmark]
pub fn contains(&self, locator: &str) -> bool
Sourcepub fn add(&mut self, label: impl Into<String>, locator: impl Into<String>)
pub fn add(&mut self, label: impl Into<String>, locator: impl Into<String>)
Add a bookmark (de-duplicated by Locator; re-adding refreshes the label).
Auto Trait Implementations§
impl Freeze for Bookmarks
impl RefUnwindSafe for Bookmarks
impl Send for Bookmarks
impl Sync for Bookmarks
impl Unpin for Bookmarks
impl UnsafeUnpin for Bookmarks
impl UnwindSafe for Bookmarks
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more