#[non_exhaustive]pub enum FormatError {
InsufficientParameters,
InvalidFormatString,
UnsupportedFormatType,
ExpectedUsize,
WriteFailed,
}Expand description
Error returned by Format::try_format.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InsufficientParameters
A placeholder index is beyond the number of supplied arguments.
InvalidFormatString
The template is syntactically invalid (unbalanced braces, named arguments, an illegal spec, …).
UnsupportedFormatType
The argument does not support the requested format type (e.g. {:x}
on a string, or the unsupported {:p}).
ExpectedUsize
The argument referenced by {:1$} / {:.1$} as a width/precision is
not an unsigned integer.
WriteFailed
The output sink rejected a write (fmt::Write::write_str returned
Err). Writing into a String never fails.
Trait Implementations§
Source§impl Clone for FormatError
impl Clone for FormatError
Source§fn clone(&self) -> FormatError
fn clone(&self) -> FormatError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FormatError
Source§impl Debug for FormatError
impl Debug for FormatError
Source§impl Display for FormatError
impl Display for FormatError
impl Eq for FormatError
Source§impl Error for FormatError
impl Error for FormatError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl Hash for FormatError
impl Hash for FormatError
Source§impl PartialEq for FormatError
impl PartialEq for FormatError
impl StructuralPartialEq for FormatError
Auto Trait Implementations§
impl Freeze for FormatError
impl RefUnwindSafe for FormatError
impl Send for FormatError
impl Sync for FormatError
impl Unpin for FormatError
impl UnsafeUnpin for FormatError
impl UnwindSafe for FormatError
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