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: usizeImplementations§
Source§impl Marks
impl Marks
Sourcepub fn setup(&mut self)
pub fn setup(&mut 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: &Path) -> Result<()>
pub fn new_mark(&mut self, ch: char, path: &Path) -> Result<()>
Store a new mark in the config file. If an update is done, the marks are saved again.
§Errors
It may fail if writing to the marks file fails.
pub fn remove_selected(&mut self) -> Result<()>
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.
Trait Implementations§
Source§impl Content<(char, PathBuf)> for Marks
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: selected, content, push, style.
selected returns an optional reference to the value.
impl Content<(char, PathBuf)> for Marks
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: selected, content, push, style.
selected returns an optional reference to the value.
Source§impl Selectable for Marks
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, set_index and selected_is_last.
impl Selectable for Marks
Implement a selectable content for this struct.
This trait allows to navigate through a vector of element content_type.
It implements: is_empty, len, next, prev, set_index and selected_is_last.
Auto Trait Implementations§
impl Freeze for Marks
impl RefUnwindSafe for Marks
impl Send for Marks
impl Sync for Marks
impl Unpin for Marks
impl UnwindSafe for Marks
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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