pub struct Bookmarks { /* private fields */ }Expand description
The saved bookmarks, kept sorted by name so the list a user sees is stable rather than ordered by when things happened to be added.
Implementations§
Source§impl Bookmarks
impl Bookmarks
pub fn new() -> Self
pub fn list(&self) -> &[Bookmark]
pub fn is_empty(&self) -> bool
Sourcepub fn add(&mut self, name: &str, path: &Path) -> bool
pub fn add(&mut self, name: &str, path: &Path) -> bool
Save path under name, replacing any bookmark of that name.
Replacing rather than duplicating means re-saving a name is how you move a bookmark, and the list can never hold two entries a user cannot tell apart. A blank name is refused.
pub fn remove(&mut self, name: &str) -> bool
pub fn resolve(&self, name: &str) -> Option<&Path>
Trait Implementations§
impl Eq for Bookmarks
impl StructuralPartialEq for Bookmarks
Auto Trait Implementations§
impl Forget for Bookmarks
impl Freeze for Bookmarks
impl Move for Bookmarks
impl RefUnwindSafe for Bookmarks
impl Send for Bookmarkswhere
RawVecInner: Send,
impl Sync for Bookmarkswhere
RawVecInner: Sync,
impl Unpin for Bookmarks
impl UnsafeUnpin for Bookmarks
impl UnwindSafe for Bookmarkswhere
RawVecInner: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.