pub enum UnityAssetError {
Io(Error),
Format(String),
UnityFormat {
message: String,
},
Class {
message: String,
},
UnknownClassId {
class_id: String,
},
PropertyNotFound {
property: String,
class_name: String,
},
TypeConversion {
from: String,
to: String,
},
Anchor {
message: String,
},
Version {
message: String,
},
Parse {
message: String,
},
WithSource {
message: String,
source: Box<dyn Error + Send + Sync>,
},
}Expand description
Main error type for Unity asset parsing operations
Variants§
Io(Error)
IO errors when reading/writing files
Format(String)
Format parsing errors (YAML, binary, etc.)
UnityFormat
Unity-specific format errors
Class
Class-related errors
UnknownClassId
Unknown class ID encountered
PropertyNotFound
Property access errors
TypeConversion
Type conversion errors
Anchor
Anchor-related errors
Version
Version compatibility errors
Parse
Generic parsing errors
WithSource
Wrap an underlying error while preserving its type as a source().
This is used by higher-level crates (e.g. environment) to add context without losing the original error kind (I/O, binary parser errors, etc).
Implementations§
Source§impl UnityAssetError
impl UnityAssetError
Sourcepub fn format<S>(message: S) -> UnityAssetError
pub fn format<S>(message: S) -> UnityAssetError
Create a format error
Sourcepub fn unity_format<S>(message: S) -> UnityAssetError
pub fn unity_format<S>(message: S) -> UnityAssetError
Create a Unity format error
Sourcepub fn class<S>(message: S) -> UnityAssetError
pub fn class<S>(message: S) -> UnityAssetError
Create a class error
Sourcepub fn property_not_found<S>(property: S, class_name: S) -> UnityAssetError
pub fn property_not_found<S>(property: S, class_name: S) -> UnityAssetError
Create a property not found error
Sourcepub fn type_conversion<S>(from: S, to: S) -> UnityAssetError
pub fn type_conversion<S>(from: S, to: S) -> UnityAssetError
Create a type conversion error
Sourcepub fn anchor<S>(message: S) -> UnityAssetError
pub fn anchor<S>(message: S) -> UnityAssetError
Create an anchor error
Sourcepub fn version<S>(message: S) -> UnityAssetError
pub fn version<S>(message: S) -> UnityAssetError
Create a version error
Sourcepub fn parse<S>(message: S) -> UnityAssetError
pub fn parse<S>(message: S) -> UnityAssetError
Create a parse error
Sourcepub fn with_source<M, E>(message: M, source: E) -> UnityAssetError
pub fn with_source<M, E>(message: M, source: E) -> UnityAssetError
Create a contextual error while preserving the underlying source error.
Trait Implementations§
Source§impl Debug for UnityAssetError
impl Debug for UnityAssetError
Source§impl Display for UnityAssetError
impl Display for UnityAssetError
Source§impl Error for UnityAssetError
impl Error for UnityAssetError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()