use derive_more::derive::{Display, Error};
use crate::{component::ComponentId, entity::Entity, schedule::InternedScheduleLabel};
#[derive(Error, Display, Debug)]
#[display("The schedule with the label {_0:?} was not found.")]
#[error(ignore)]
pub struct TryRunScheduleError(pub InternedScheduleLabel);
#[derive(Error, Display, Debug, Clone, Copy, PartialEq, Eq)]
pub enum EntityComponentError {
#[display("The component with ID {_0:?} does not exist on the entity.")]
#[error(ignore)]
MissingComponent(ComponentId),
#[display("The component with ID {_0:?} was requested mutably more than once.")]
#[error(ignore)]
AliasedMutability(ComponentId),
}
#[derive(Error, Display, Debug, Clone, Copy, PartialEq, Eq)]
pub enum EntityFetchError {
#[display("The entity with ID {_0:?} does not exist.")]
#[error(ignore)]
NoSuchEntity(Entity),
#[display("The entity with ID {_0:?} was requested mutably more than once.")]
#[error(ignore)]
AliasedMutability(Entity),
}