Struct inquire::ui::ErrorMessageRenderConfig
source · [−]pub struct ErrorMessageRenderConfig {
pub prefix: Styled<&'static str>,
pub separator: StyleSheet,
pub message: StyleSheet,
pub default_message: &'static str,
}
Expand description
Render configuration for error messages.
Fields
prefix: Styled<&'static str>
Prefix style.
separator: StyleSheet
Separator style.
Note: This separator is a space character. It might be useful to style it if you want to set a background color for error messages.
message: StyleSheet
Message style.
default_message: &'static str
Default message used for validators that do not defined custom error messages.
Implementations
sourceimpl ErrorMessageRenderConfig
impl ErrorMessageRenderConfig
sourcepub fn default_colored() -> Self
pub fn default_colored() -> Self
Render configuration where default colors and attributes are applied.
sourcepub fn with_prefix(self, prefix: Styled<&'static str>) -> Self
pub fn with_prefix(self, prefix: Styled<&'static str>) -> Self
Sets the prefix.
sourcepub fn with_separator(self, separator: StyleSheet) -> Self
pub fn with_separator(self, separator: StyleSheet) -> Self
Sets the separator stylesheet.
Note: This separator is a space character. It might be useful to style it if you want to set a background color for error messages.
sourcepub fn with_message(self, message: StyleSheet) -> Self
pub fn with_message(self, message: StyleSheet) -> Self
Sets the message stylesheet.
Trait Implementations
sourceimpl Clone for ErrorMessageRenderConfig
impl Clone for ErrorMessageRenderConfig
sourcefn clone(&self) -> ErrorMessageRenderConfig
fn clone(&self) -> ErrorMessageRenderConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ErrorMessageRenderConfig
impl Debug for ErrorMessageRenderConfig
impl Copy for ErrorMessageRenderConfig
Auto Trait Implementations
impl RefUnwindSafe for ErrorMessageRenderConfig
impl Send for ErrorMessageRenderConfig
impl Sync for ErrorMessageRenderConfig
impl Unpin for ErrorMessageRenderConfig
impl UnwindSafe for ErrorMessageRenderConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more