pub struct DefaultMessageFormatter;Expand description
Default developer-oriented message formatter.
This formatter at places produces recommendations on how to adjust settings and API calls for the parsing to work, so normally should not be user-facing. Use UserMessageFormatter for user-facing content, or implement custom MessageFormatter for full control over output.
Implementations§
Source§impl DefaultMessageFormatter
impl DefaultMessageFormatter
Sourcepub fn with_localizer<'a>(
&self,
localizer: &'a dyn Localizer,
) -> DefaultMessageFormatterWithLocalizer<'a>
pub fn with_localizer<'a>( &self, localizer: &'a dyn Localizer, ) -> DefaultMessageFormatterWithLocalizer<'a>
Return a formatter that uses a custom Localizer.
This allows reusing the built-in developer-oriented messages while customizing
wording that is produced outside format_message (location suffixes, validation
issue composition, snippet labels, etc.).
Trait Implementations§
Source§impl Clone for DefaultMessageFormatter
impl Clone for DefaultMessageFormatter
Source§fn clone(&self) -> DefaultMessageFormatter
fn clone(&self) -> DefaultMessageFormatter
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 DefaultMessageFormatter
impl Debug for DefaultMessageFormatter
Source§impl Default for DefaultMessageFormatter
impl Default for DefaultMessageFormatter
Source§fn default() -> DefaultMessageFormatter
fn default() -> DefaultMessageFormatter
Returns the “default value” for a type. Read more
impl Copy for DefaultMessageFormatter
Auto Trait Implementations§
impl Freeze for DefaultMessageFormatter
impl RefUnwindSafe for DefaultMessageFormatter
impl Send for DefaultMessageFormatter
impl Sync for DefaultMessageFormatter
impl Unpin for DefaultMessageFormatter
impl UnsafeUnpin for DefaultMessageFormatter
impl UnwindSafe for DefaultMessageFormatter
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