pub struct InputHistory { /* private fields */ }Expand description
The whole input history, read and written from and to a file. It’s filtered by content. If the flag “log_are_enabled” is set to false, it will not be updated in the logs.
Implementations§
Source§impl InputHistory
impl InputHistory
pub fn load(path: &str) -> Result<Self>
pub fn filter_by_mode(&mut self, menu_mode: Menu)
pub fn prev(&mut self)
pub fn next(&mut self)
pub fn current(&self) -> Option<&HistoryElement>
Sourcepub fn update(&mut self, mode: Menu, input_string: &str) -> Result<()>
pub fn update(&mut self, mode: Menu, input_string: &str) -> Result<()>
If logs are disabled, nothing is saved on disk, only during current session
Sourcepub fn is_mode_logged(&self, mode: &Menu) -> bool
pub fn is_mode_logged(&self, mode: &Menu) -> bool
True iff the mode is logged. It’s almost always the case, only password mode isn’t saved. This method is usefull to check if an input should be replaced when the user want to.
pub fn filtered_as_list(&self) -> Vec<String>
pub fn filtered_is_empty(&self) -> bool
Auto Trait Implementations§
impl Freeze for InputHistory
impl RefUnwindSafe for InputHistory
impl Send for InputHistory
impl Sync for InputHistory
impl Unpin for InputHistory
impl UnwindSafe for InputHistory
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> 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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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>
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