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 copy 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 more