pub struct ParseError;Expand description
Represents errors emitted while processing strings (UTF-8 or otherwise).
This error type is commonly associated with:
- The
std::str::FromStrtrait - The
.parse::<T>()method - String validation and formatting operations
Implementations§
Source§impl ParseError
impl ParseError
Sourcepub fn with_field(field: &'static str) -> Report<Self>
pub fn with_field(field: &'static str) -> Report<Self>
Create a parse error for an invalid field.
This method creates a ParseError report indicating that a specific
field could not be parsed correctly.
Trait Implementations§
Source§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
Source§impl Error for ParseError
impl Error for ParseError
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 ThinContext for ParseError
impl ThinContext for ParseError
Source§fn report<C: Context>(ctx: C) -> Report<Self>
fn report<C: Context>(ctx: C) -> Report<Self>
Create a new error report by converting from another context type. Read more
Source§fn attach_with<A>(attachment: impl FnOnce() -> A) -> Report<Self>where
A: Display,
fn attach_with<A>(attachment: impl FnOnce() -> A) -> Report<Self>where
A: Display,
Create an error report with an attachment computed by a closure. Read more
Source§fn attach<A>(value: A) -> Report<Self>where
A: Display,
fn attach<A>(value: A) -> Report<Self>where
A: Display,
Create an error report with a displayable attachment.
Source§fn attach_dbg<A>(value: A) -> Report<Self>where
A: Debug,
fn attach_dbg<A>(value: A) -> Report<Self>where
A: Debug,
Create an error report with a debug-formatted attachment. Read more
Source§fn attach_kv<K, V>(key: K, value: V) -> Report<Self>
fn attach_kv<K, V>(key: K, value: V) -> Report<Self>
Create an error report with a key-value pair attachment.
Source§fn attach_kv_dbg<K, V>(key: K, value: V) -> Report<Self>
fn attach_kv_dbg<K, V>(key: K, value: V) -> Report<Self>
Create an error report with a key-value pair where the value is debug-formatted.
Source§fn attach_field<S: Display>(key: &'static str, status: S) -> Report<Self>
fn attach_field<S: Display>(key: &'static str, status: S) -> Report<Self>
Create an error report with a field attachment. Read more
Source§fn expected_actual<A: Display>(expected: A, actual: A) -> Report<Self>
fn expected_actual<A: Display>(expected: A, actual: A) -> Report<Self>
Create an error report showing expected vs actual values. Read more
Source§fn attach_ty_val<A: Display>(value: A) -> Report<Self>
fn attach_ty_val<A: Display>(value: A) -> Report<Self>
Create an error report with a type-value pair attachment. Read more
Source§fn attach_ty_dbg<A: Debug>(value: A) -> Report<Self>
fn attach_ty_dbg<A: Debug>(value: A) -> Report<Self>
Create an error report with a type-value pair where the value is debug-formatted.
Auto Trait Implementations§
impl Freeze for ParseError
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnwindSafe for ParseError
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