pub struct Marks { /* private fields */ }Expand description
Holds the marks created by the user. It’s an ordered map between any char (except :) and a PathBuf.
Implementations§
source§impl Marks
impl Marks
sourcepub fn read_from_config_file() -> Self
pub fn read_from_config_file() -> Self
Reads the marks stored in the config file (~/.config/fm/marks.cfg). If an invalid marks is read, only the valid ones are kept and the file is saved again.
sourcepub fn get(&self, ch: char) -> Option<&PathBuf>
pub fn get(&self, ch: char) -> Option<&PathBuf>
Returns an optional marks associated to a char bind.
sourcepub fn new_mark(&mut self, ch: char, path: PathBuf) -> FmResult<()>
pub fn new_mark(&mut self, ch: char, path: PathBuf) -> FmResult<()>
Store a new mark in the config file. All the marks are saved again.
sourcepub fn as_strings(&self) -> Vec<String> ⓘ
pub fn as_strings(&self) -> Vec<String> ⓘ
Returns a vector of strings like “d: /dev” for every mark.