1use derive_more::derive::{Display, Error};
4
5use crate::{component::ComponentId, entity::Entity, schedule::InternedScheduleLabel};
6
7#[derive(Error, Display, Debug)]
11#[display("The schedule with the label {_0:?} was not found.")]
12#[error(ignore)]
13pub struct TryRunScheduleError(pub InternedScheduleLabel);
14
15#[derive(Error, Display, Debug, Clone, Copy, PartialEq, Eq)]
17pub enum EntityComponentError {
18 #[display("The component with ID {_0:?} does not exist on the entity.")]
20 #[error(ignore)]
21 MissingComponent(ComponentId),
22 #[display("The component with ID {_0:?} was requested mutably more than once.")]
24 #[error(ignore)]
25 AliasedMutability(ComponentId),
26}
27
28#[derive(Error, Display, Debug, Clone, Copy, PartialEq, Eq)]
30pub enum EntityFetchError {
31 #[display("The entity with ID {_0:?} does not exist.")]
33 #[error(ignore)]
34 NoSuchEntity(Entity),
35 #[display("The entity with ID {_0:?} was requested mutably more than once.")]
37 #[error(ignore)]
38 AliasedMutability(Entity),
39}