#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
#[repr(u8)]
pub enum AssetCallbackFlag {
#[default]
Disabled = Self::DISABLED,
Enabled = Self::ENABLED,
}
impl AssetCallbackFlag {
pub(crate) const DISABLED: u8 = 0;
pub(crate) const ENABLED: u8 = 1;
pub const fn as_u8(&self) -> u8 {
*self as u8
}
pub const fn is_enabled(&self) -> bool {
matches!(self, Self::Enabled)
}
}
impl From<bool> for AssetCallbackFlag {
fn from(enabled: bool) -> Self {
if enabled { Self::Enabled } else { Self::Disabled }
}
}