bevy_assets_extensions 0.7.0

Extensions for bevy assets, with support of collection as assets and a loader manager.
Documentation
use bevy::{asset::ParseAssetPathError, ecs::error::BevyError};
use thiserror::Error;

/// Error type
#[derive(Error, Debug)]
#[allow(missing_docs)]
#[non_exhaustive]
pub enum Error {
    // #[error("Bundle loading")]
    #[error("Error during ron deserialisation {0}.")]
    RonSpannedError(#[from] ron::error::SpannedError),
    #[error("IOError: {0}.")]
    IOError(#[from] std::io::Error),
    #[error("Utf8Error: {0}.")]
    StrUtf8Error(#[from] std::str::Utf8Error),
    #[error("Utf8Error: {0}.")]
    StringUtf8Error(#[from] std::string::FromUtf8Error),
    #[error("Bevy Load Error: {0}")]
    LoadDirectError(#[from] bevy::asset::LoadDirectError),
    #[error("Unknown asset key: {key}")]
    UnknownAssetKey { key: String },
    #[error("Invalid asset cast, expected: {expected} got {got}.")]
    InvalidAssetCast {
        expected: &'static str,
        got: &'static str,
    },
    #[error("Key {key} has an incompatible entry.")]
    IncompatibleEntry { key: String },
    #[error("An error occurred in bevy {message}.")]
    BevyError { message: String },
    #[error("Error parsing asset path {0}.")]
    ParseAssetPathError(#[from] ParseAssetPathError),
}

impl From<BevyError> for Error {
    fn from(value: BevyError) -> Self {
        Self::BevyError {
            message: format!("BevyError: {}", value),
        }
    }
}