Skip to main content

euv_engine/asset/
enum.rs

1use super::*;
2
3/// Categorizes the type of a game asset for appropriate loading and storage.
4#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
5pub enum AssetType {
6    /// An image asset (PNG, JPEG, SVG, etc.) loaded as `HtmlImageElement`.
7    #[default]
8    Image,
9    /// An audio asset loaded as an `AudioBuffer` for Web Audio playback.
10    Audio,
11    /// A generic binary data asset loaded as a `Vec<u8>`.
12    Data,
13}
14
15/// Represents the loading state of an asset in the cache.
16#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17pub enum AssetState {
18    /// The asset has been requested but is still loading.
19    #[default]
20    Loading,
21    /// The asset has been successfully loaded and is ready for use.
22    Loaded,
23    /// The asset failed to load.
24    Error,
25}