pub struct Marks {
pub index: usize,
/* private fields */
}Expand description
Holds the marks created by the user. It’s an ordered map between any char (except :) and a PathBuf.
Fields§
§index: usizeThe currently selected shortcut
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, key: char) -> Option<PathBuf>
pub fn get(&self, key: char) -> Option<PathBuf>
Returns an optional marks associated to a char bind.
sourcepub fn new_mark(&mut self, ch: char, path: PathBuf) -> Result<()>
pub fn new_mark(&mut self, ch: char, path: PathBuf) -> Result<()>
Store a new mark in the config file. If an update is done, 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.