pub struct ErrorMessageRenderConfig<'a> {
pub prefix: Styled<&'a str>,
pub separator: StyleSheet,
pub message: StyleSheet,
pub default_message: &'a str,
}Expand description
Render configuration for error messages.
Fields§
§prefix: Styled<&'a str>Prefix style.
separator: StyleSheetSeparator 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: StyleSheetMessage style.
default_message: &'a strDefault message used for validators that do not defined custom error messages.
Implementations§
Source§impl<'a> ErrorMessageRenderConfig<'a>
impl<'a> ErrorMessageRenderConfig<'a>
Sourcepub fn empty() -> ErrorMessageRenderConfig<'a>
pub fn empty() -> ErrorMessageRenderConfig<'a>
Render configuration in which no colors or attributes are applied.
Sourcepub fn default_colored() -> ErrorMessageRenderConfig<'a>
pub fn default_colored() -> ErrorMessageRenderConfig<'a>
Render configuration where default colors and attributes are applied.
Sourcepub fn with_prefix(
self,
prefix: Styled<&'a str>,
) -> ErrorMessageRenderConfig<'a>
pub fn with_prefix( self, prefix: Styled<&'a str>, ) -> ErrorMessageRenderConfig<'a>
Sets the prefix.
Sourcepub fn with_separator(
self,
separator: StyleSheet,
) -> ErrorMessageRenderConfig<'a>
pub fn with_separator( self, separator: StyleSheet, ) -> ErrorMessageRenderConfig<'a>
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) -> ErrorMessageRenderConfig<'a>
pub fn with_message(self, message: StyleSheet) -> ErrorMessageRenderConfig<'a>
Sets the message stylesheet.
Trait Implementations§
Source§impl<'a> Clone for ErrorMessageRenderConfig<'a>
impl<'a> Clone for ErrorMessageRenderConfig<'a>
Source§fn clone(&self) -> ErrorMessageRenderConfig<'a>
fn clone(&self) -> ErrorMessageRenderConfig<'a>
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<'a> Debug for ErrorMessageRenderConfig<'a>
impl<'a> Debug for ErrorMessageRenderConfig<'a>
impl<'a> Copy for ErrorMessageRenderConfig<'a>
Auto Trait Implementations§
impl<'a> Freeze for ErrorMessageRenderConfig<'a>
impl<'a> RefUnwindSafe for ErrorMessageRenderConfig<'a>
impl<'a> Send for ErrorMessageRenderConfig<'a>
impl<'a> Sync for ErrorMessageRenderConfig<'a>
impl<'a> Unpin for ErrorMessageRenderConfig<'a>
impl<'a> UnwindSafe for ErrorMessageRenderConfig<'a>
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> 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