#[non_exhaustive]pub enum AssetError {
Loader(AssetLoadError),
TypeDropped,
TypeNotFound(String),
Other(Error),
}Expand description
Errors that can occur during asset operations.
This enum represents all possible errors that can happen when working with assets, including loading, type resolution, and general asset manipulation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Loader(AssetLoadError)
Error occurred during asset loading from bytes.
This variant wraps loader-specific errors that can happen when attempting to deserialize asset data from raw bytes using an asset type’s loader.
TypeDropped
The asset type reference has been dropped and is no longer available.
This error occurs when trying to access an asset type through a weak reference that can no longer be upgraded because the asset type has been dropped from memory.
TypeNotFound(String)
The specified asset type could not be found in the asset manager.
This error occurs when attempting to look up an asset type by name that is not registered in the asset manager.
Other(Error)
Any other error that doesn’t fit into the specific categories above.
This is a catch-all variant for wrapping other error types that may occur during asset operations.
Trait Implementations§
Source§impl Debug for AssetError
impl Debug for AssetError
Source§impl Display for AssetError
impl Display for AssetError
Source§impl Error for AssetError
impl Error for AssetError
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()
Source§impl From<AssetLoadError> for AssetError
impl From<AssetLoadError> for AssetError
Source§fn from(source: AssetLoadError) -> Self
fn from(source: AssetLoadError) -> Self
Auto Trait Implementations§
impl Freeze for AssetError
impl RefUnwindSafe for AssetError
impl Send for AssetError
impl Sync for AssetError
impl Unpin for AssetError
impl UnsafeUnpin for AssetError
impl UnwindSafe for AssetError
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.