pub enum ParseError {
Xml(Error),
Io {
path: PathBuf,
source: Error,
},
BadAttribute {
tag: String,
attr: String,
message: String,
},
BadAttributeValue {
tag: String,
attr: String,
value: String,
message: String,
},
BadInclude {
file: PathBuf,
message: String,
},
UnknownClass {
tag: String,
class: String,
},
Unsupported {
feature: String,
hint: Option<String>,
},
InvalidModel(String),
}Expand description
Errors that can be returned while parsing an MJCF document.
Variants§
Xml(Error)
The XML failed to parse.
Io
I/O error while reading a file (or one of its <include> targets).
BadAttribute
An attribute couldn’t be parsed.
BadAttributeValue
An attribute had an unexpected value.
Fields
BadInclude
<include> referenced a file that wasn’t found, or formed a cycle.
UnknownClass
<element class="…"> referenced a class that doesn’t exist.
Unsupported
A feature is parsed but not supported by this version of the loader.
InvalidModel(String)
A body referenced a parent that wasn’t found.
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
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()
Auto Trait Implementations§
impl !RefUnwindSafe for ParseError
impl !UnwindSafe for ParseError
impl Freeze for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnsafeUnpin 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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.