pub struct RecentFiles { /* private fields */ }Expand description
最近文件列表;最新在最前,重复 push 会前移而不新增。
Implementations§
Source§impl RecentFiles
impl RecentFiles
pub fn new(limit: usize) -> Self
pub fn push(&mut self, path: impl Into<PathBuf>)
pub fn remove(&mut self, path: &Path)
pub fn clear(&mut self)
pub fn iter(&self) -> impl Iterator<Item = &PathBuf>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn is_dirty(&self) -> bool
pub fn load(&mut self, path: &Path) -> Result<()>
pub fn save(&mut self, path: &Path) -> Result<()>
Trait Implementations§
Source§impl Clone for RecentFiles
impl Clone for RecentFiles
Auto Trait Implementations§
impl Forget for RecentFiles
impl Freeze for RecentFiles
impl Move for RecentFiles
impl RefUnwindSafe for RecentFiles
impl Send for RecentFiles
impl Sync for RecentFiles
impl Unpin for RecentFiles
impl UnsafeUnpin for RecentFiles
impl UnwindSafe for RecentFiles
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