pub struct ParseError {
pub filename: String,
pub parse_error: Option<Box<dyn Error>>,
}
Expand description
Error related to parsing the content of an LDraw file.
Fields§
§filename: String
Filename of the sub-file reference, generally relative to some canonical catalog path(s).
parse_error: Option<Box<dyn Error>>
Optional underlying error raised by the internal parser.
Implementations§
Source§impl ParseError
impl ParseError
Sourcepub fn new(filename: &str, err: impl Into<Box<dyn Error>>) -> Self
pub fn new(filename: &str, err: impl Into<Box<dyn Error>>) -> Self
Create a ParseError
that stems from an arbitrary error of an underlying parser.
Sourcepub fn new_from_nom(filename: &str, err: &Err<(&[u8], ErrorKind)>) -> Self
pub fn new_from_nom(filename: &str, err: &Err<(&[u8], ErrorKind)>) -> Self
Create a ParseError
that stems from a nom
parsing error, capturing the nom::error::ErrorKind
from the underlying parser which failed.
Trait Implementations§
Source§impl Debug for ParseError
impl Debug for ParseError
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(e: ParseError) -> Self
fn from(e: ParseError) -> Self
Converts to this type from the input type.
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