pub struct Prompt {
pub prompt: String,
pub vi_status: Option<ViStatus>,
}Expand description
User-defined prompt.
§Examples
For Emacs mode, you simply define a static prompt that holds a string.
let prompt = Prompt::from("prompt$ ");
assert_eq!(&prompt.to_string(), "prompt$ ");You can also display Vi mode indicator in your prompt.
let prompt = Prompt {
prompt: "prompt$ ".into(),
vi_status: Some(ViStatus::default()),
};
assert_eq!(&prompt.to_string(), "[I] prompt$ ");Fields§
§prompt: String§vi_status: Option<ViStatus>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Prompt
impl RefUnwindSafe for Prompt
impl Send for Prompt
impl Sync for Prompt
impl Unpin for Prompt
impl UnwindSafe for Prompt
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> 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