pub struct PromptConfig {
pub prefix: String,
pub suffix: String,
pub fg_color: Color,
pub bg_color: Option<Color>,
pub show_context: bool,
}Expand description
Prompt configuration
Fields§
§prefix: StringPrompt prefix
suffix: StringPrompt suffix
fg_color: ColorForeground color
bg_color: Option<Color>Background color
show_context: boolShow context
Implementations§
Source§impl PromptConfig
impl PromptConfig
Sourcepub fn with_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_prefix(self, prefix: impl Into<String>) -> Self
Set prefix
Sourcepub fn with_suffix(self, suffix: impl Into<String>) -> Self
pub fn with_suffix(self, suffix: impl Into<String>) -> Self
Set suffix
Sourcepub fn with_fg_color(self, color: Color) -> Self
pub fn with_fg_color(self, color: Color) -> Self
Set foreground color
Sourcepub fn with_bg_color(self, color: Color) -> Self
pub fn with_bg_color(self, color: Color) -> Self
Set background color
Sourcepub fn with_show_context(self, show: bool) -> Self
pub fn with_show_context(self, show: bool) -> Self
Set show context
Trait Implementations§
Source§impl Clone for PromptConfig
impl Clone for PromptConfig
Source§fn clone(&self) -> PromptConfig
fn clone(&self) -> PromptConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PromptConfig
impl Debug for PromptConfig
Auto Trait Implementations§
impl Freeze for PromptConfig
impl RefUnwindSafe for PromptConfig
impl Send for PromptConfig
impl Sync for PromptConfig
impl Unpin for PromptConfig
impl UnwindSafe for PromptConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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