Struct relp::io::error::Parse [−][src]
pub struct Parse { /* fields omitted */ }
Expand description
A ParseError
represents all errors encountered during parsing.
It may recursively hold more ParseError
s to provide more detail. At the end of this chain, there
may be a file location containing a line number and line, at which the error was caused.
Implementations
impl Parse
[src]
impl Parse
[src]pub fn new(description: impl Into<String>) -> Self
[src]
pub fn new(description: impl Into<String>) -> Self
[src]Create a new ParseError
with only a description.
Arguments
description
: What’s wrong at the moment of creation.
Return value
- A
ParseError
instance without a cause.
pub fn with_location(
description: impl Into<String>,
file_location: (usize, &'_ str)
) -> Self
[src]
pub fn with_location(
description: impl Into<String>,
file_location: (usize, &'_ str)
) -> Self
[src]Create a new ParseError
instance with a FileLocation
as a cause.
Arguments
description
: What’s wrong at the moment of creation.file_location
: A reference to a line number and line that caused the error.
Return value
A new ParseError
instance with a FileLocation
cause.
pub fn wrap(self, description: impl Into<String>) -> Self
[src]
pub fn wrap(self, description: impl Into<String>) -> Self
[src]Wrap a description into a parse error.
pub fn wrap_other(
source: impl Error + 'static,
description: impl Into<String>
) -> Self
[src]
pub fn wrap_other(
source: impl Error + 'static,
description: impl Into<String>
) -> Self
[src]Wrap a new ParseError
around an existing one.
Arguments
description
: What’s wrong at the moment of creation.parse_error
: What caused thisParseError
.
Return value
A new ParseError
instance with a ParseError
cause.
Trait Implementations
impl Error for Parse
[src]
impl Error for Parse
[src]fn description(&self) -> &str
[src]
👎 Deprecated since 1.42.0: use the Display impl or to_string()
fn description(&self) -> &str
[src]👎 Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations
impl !RefUnwindSafe for Parse
impl !Send for Parse
impl !Sync for Parse
impl Unpin for Parse
impl !UnwindSafe for Parse
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more