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§
Source§impl ErrorMessageRenderConfig
impl ErrorMessageRenderConfig
Sourcepub fn empty() -> ErrorMessageRenderConfig
pub fn empty() -> ErrorMessageRenderConfig
Render configuration in which no colors or attributes are applied.
Sourcepub fn default_colored() -> ErrorMessageRenderConfig
pub fn default_colored() -> ErrorMessageRenderConfig
Render configuration where default colors and attributes are applied.
Sourcepub fn with_prefix(
self,
prefix: Styled<&'static str>,
) -> ErrorMessageRenderConfig
pub fn with_prefix( self, prefix: Styled<&'static str>, ) -> ErrorMessageRenderConfig
Sets the prefix.
Sourcepub fn with_separator(self, separator: StyleSheet) -> ErrorMessageRenderConfig
pub fn with_separator(self, separator: StyleSheet) -> ErrorMessageRenderConfig
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
pub fn with_message(self, message: StyleSheet) -> ErrorMessageRenderConfig
Sets the message stylesheet.
Trait Implementations§
Source§impl Clone for ErrorMessageRenderConfig
impl Clone for ErrorMessageRenderConfig
Source§fn clone(&self) -> ErrorMessageRenderConfig
fn clone(&self) -> ErrorMessageRenderConfig
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 ErrorMessageRenderConfig
impl Debug for ErrorMessageRenderConfig
impl Copy for ErrorMessageRenderConfig
Auto Trait Implementations§
impl Freeze for ErrorMessageRenderConfig
impl RefUnwindSafe for ErrorMessageRenderConfig
impl Send for ErrorMessageRenderConfig
impl Sync for ErrorMessageRenderConfig
impl Unpin for ErrorMessageRenderConfig
impl UnwindSafe for ErrorMessageRenderConfig
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