Struct abortable_parser::Error [−][src]
pub struct Error { /* fields omitted */ }
The custom error type for use in Result::{Fail, Abort}
.
Stores a wrapped err that must implement Display as well as an offset and
an optional cause.
Methods
impl Error
[src]
impl Error
pub fn new<S, D: Into<String>>(msg: D, offset: &S) -> Self where
S: Offsetable,
[src]
pub fn new<S, D: Into<String>>(msg: D, offset: &S) -> Self where
S: Offsetable,
Constructs a new Error with an offset and no cause.
pub fn caused_by<'a, S, D: Into<String>>(
msg: D,
offset: &'a S,
cause: Box<Self>
) -> Self where
S: Offsetable,
[src]
pub fn caused_by<'a, S, D: Into<String>>(
msg: D,
offset: &'a S,
cause: Box<Self>
) -> Self where
S: Offsetable,
Constructs a new Error with an offset and a cause.
pub fn get_msg<'a>(&'a self) -> String
[src]
pub fn get_msg<'a>(&'a self) -> String
Returns the msg.
pub fn get_cause<'a>(&'a self) -> Option<&'a Error>
[src]
pub fn get_cause<'a>(&'a self) -> Option<&'a Error>
Returns Some(cause)
if there is one, None otherwise.
pub fn get_offset(&self) -> usize
[src]
pub fn get_offset(&self) -> usize
Trait Implementations
impl Debug for Error
[src]
impl Debug for Error
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Display for Error
[src]
impl Display for Error
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Error for Error
[src]
impl Error for Error