pub struct FileBrowserState { /* private fields */ }Expand description
Persistent per-host file-browser state: last-visited paths per alias.
Implementations§
Source§impl FileBrowserState
impl FileBrowserState
pub fn host_path(&self, alias: &str) -> Option<&(PathBuf, String)>
pub fn contains_host(&self, alias: &str) -> bool
pub fn set_host_path(&mut self, alias: String, local: PathBuf, remote: String)
Sourcepub fn prune_orphans(&mut self, valid_aliases: &HashSet<&str>)
pub fn prune_orphans(&mut self, valid_aliases: &HashSet<&str>)
Drop host_paths entries whose alias is no longer in
valid_aliases. Called from App::reload_hosts so a host rename
or delete cannot leave the old alias behind as a leaked entry.
Sourcepub fn migrate_alias(&mut self, old: &str, new: &str)
pub fn migrate_alias(&mut self, old: &str, new: &str)
Move the host_paths entry from old to new on host rename.
Called from App::migrate_alias_keyed_caches before
reload_hosts, whose prune step would otherwise drop the
entry under the old alias. No-op when old == new.
Trait Implementations§
Source§impl Clone for FileBrowserState
impl Clone for FileBrowserState
Source§fn clone(&self) -> FileBrowserState
fn clone(&self) -> FileBrowserState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileBrowserState
impl Debug for FileBrowserState
Source§impl Default for FileBrowserState
impl Default for FileBrowserState
Source§fn default() -> FileBrowserState
fn default() -> FileBrowserState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FileBrowserState
impl RefUnwindSafe for FileBrowserState
impl Send for FileBrowserState
impl Sync for FileBrowserState
impl Unpin for FileBrowserState
impl UnsafeUnpin for FileBrowserState
impl UnwindSafe for FileBrowserState
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more