pub struct ReadableError { /* private fields */ }Expand description
Error struct to represent parsing errors in a more user-friendly way.
Implementations§
Source§impl ReadableError
impl ReadableError
Sourcepub fn from_parse(error: ParseError<&str, ContextError>, input: &str) -> Self
pub fn from_parse(error: ParseError<&str, ContextError>, input: &str) -> Self
Constructs Self from parse error & input.
Sourcepub fn from_context<T>(
error: ErrMode<ContextError>,
input: T,
err_pos: usize,
) -> Selfwhere
T: Display,
pub fn from_context<T>(
error: ErrMode<ContextError>,
input: T,
err_pos: usize,
) -> Selfwhere
T: Display,
Constructs Self from parse error & input.
pub fn from_display<T, U>(message: T, input: U, err_pos: usize) -> Self
Trait Implementations§
Source§impl Clone for ReadableError
impl Clone for ReadableError
Source§fn clone(&self) -> ReadableError
fn clone(&self) -> ReadableError
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 ReadableError
impl Debug for ReadableError
Source§impl Default for ReadableError
impl Default for ReadableError
Source§fn default() -> ReadableError
fn default() -> ReadableError
Returns the “default value” for a type. Read more
Source§impl Display for ReadableError
impl Display for ReadableError
Source§impl Error for ReadableError
impl Error for ReadableError
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 From<ReadableError> for Error
impl From<ReadableError> for Error
Source§fn from(error: ReadableError) -> Self
fn from(error: ReadableError) -> Self
Converts to this type from the input type.
Source§impl Hash for ReadableError
impl Hash for ReadableError
Source§impl PartialEq for ReadableError
impl PartialEq for ReadableError
impl Eq for ReadableError
impl StructuralPartialEq for ReadableError
Auto Trait Implementations§
impl Freeze for ReadableError
impl RefUnwindSafe for ReadableError
impl Send for ReadableError
impl Sync for ReadableError
impl Unpin for ReadableError
impl UnwindSafe for ReadableError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more