Struct Schedules
pub struct Schedules {
pub ignored_scheduling_ambiguities: BTreeSet<ComponentId>,
/* private fields */
}Expand description
Fields§
§ignored_scheduling_ambiguities: BTreeSet<ComponentId>List of [ComponentId]s to ignore when reporting system order ambiguity conflicts
Implementations§
§impl Schedules
impl Schedules
pub fn insert(&mut self, schedule: Schedule) -> Option<Schedule>
pub fn insert(&mut self, schedule: Schedule) -> Option<Schedule>
Inserts a labeled schedule into the map.
If the map already had an entry for label, schedule is inserted,
and the old schedule is returned. Otherwise, None is returned.
pub fn reinsert(&mut self, schedule: Schedule) -> Option<Schedule>
pub fn reinsert(&mut self, schedule: Schedule) -> Option<Schedule>
Inserts a labeled schedule into the map.
If the map already had an entry for label, schedule is inserted,
and the old schedule is returned. Otherwise, None is returned.
pub fn remove(&mut self, label: impl ScheduleLabel) -> Option<Schedule>
pub fn remove(&mut self, label: impl ScheduleLabel) -> Option<Schedule>
Removes the schedule corresponding to the label from the map, returning it if it existed.
pub fn remove_temporarily(
&mut self,
label: impl ScheduleLabel,
) -> Option<Schedule>
pub fn remove_temporarily( &mut self, label: impl ScheduleLabel, ) -> Option<Schedule>
Removes the schedule corresponding to the label from the map, returning it if it existed, tracks.
pub fn remove_entry(
&mut self,
label: impl ScheduleLabel,
) -> Option<(Interned<dyn ScheduleLabel>, Schedule)>
pub fn remove_entry( &mut self, label: impl ScheduleLabel, ) -> Option<(Interned<dyn ScheduleLabel>, Schedule)>
Removes the (schedule, label) pair corresponding to the label from the map, returning it if it existed.
pub fn get_temporarily_removed(&self) -> HashSet<Interned<dyn ScheduleLabel>>
pub fn get_temporarily_removed(&self) -> HashSet<Interned<dyn ScheduleLabel>>
Gets a set of temporarily removed schedules
pub fn get_empty_labels(&self) -> HashSet<Interned<dyn ScheduleLabel>>
pub fn get_empty_labels(&self) -> HashSet<Interned<dyn ScheduleLabel>>
Gets a set of empty schedule labels
pub fn contains(&self, label: impl ScheduleLabel) -> bool
pub fn contains(&self, label: impl ScheduleLabel) -> bool
Does a schedule with the provided label already exist?
pub fn get(&self, label: impl ScheduleLabel) -> Option<&Schedule>
pub fn get(&self, label: impl ScheduleLabel) -> Option<&Schedule>
Returns a reference to the schedule associated with label, if it exists.
pub fn get_mut(&mut self, label: impl ScheduleLabel) -> Option<&mut Schedule>
pub fn get_mut(&mut self, label: impl ScheduleLabel) -> Option<&mut Schedule>
Returns a mutable reference to the schedule associated with label, if it exists.
pub fn entry(&mut self, label: impl ScheduleLabel) -> &mut Schedule
pub fn entry(&mut self, label: impl ScheduleLabel) -> &mut Schedule
Returns a mutable reference to the schedules associated with label, creating one if it doesn’t already exist.
pub fn iter(
&self,
) -> impl Iterator<Item = (&(dyn ScheduleLabel + 'static), &Schedule)>
pub fn iter( &self, ) -> impl Iterator<Item = (&(dyn ScheduleLabel + 'static), &Schedule)>
Returns an iterator over all schedules. Iteration order is undefined.
pub fn iter_mut(
&mut self,
) -> impl Iterator<Item = (&(dyn ScheduleLabel + 'static), &mut Schedule)>
pub fn iter_mut( &mut self, ) -> impl Iterator<Item = (&(dyn ScheduleLabel + 'static), &mut Schedule)>
Returns an iterator over mutable references to all schedules. Iteration order is undefined.
pub fn configure_schedules(
&mut self,
schedule_build_settings: ScheduleBuildSettings,
)
pub fn configure_schedules( &mut self, schedule_build_settings: ScheduleBuildSettings, )
Applies the provided [ScheduleBuildSettings] to all schedules.
This mutates all currently present schedules, but does not apply to schedules added in the future.
pub fn allow_ambiguous_component<T>(&mut self, world: &mut World)where
T: Component,
pub fn allow_ambiguous_component<T>(&mut self, world: &mut World)where
T: Component,
Ignore system order ambiguities caused by conflicts on Components of type T.
pub fn allow_ambiguous_resource<T>(&mut self, world: &mut World)where
T: Resource,
pub fn allow_ambiguous_resource<T>(&mut self, world: &mut World)where
T: Resource,
Ignore system order ambiguities caused by conflicts on Resources of type T.
pub fn iter_ignored_ambiguities(&self) -> impl Iterator<Item = &ComponentId>
pub fn iter_ignored_ambiguities(&self) -> impl Iterator<Item = &ComponentId>
Iterate through the [ComponentId]’s that will be ignored.
pub fn print_ignored_ambiguities(&self, components: &Components)
pub fn print_ignored_ambiguities(&self, components: &Components)
Prints the names of the components and resources with info
May panic or retrieve incorrect names if [Components] is not from the same
world
pub fn add_systems<M>(
&mut self,
schedule: impl ScheduleLabel,
systems: impl IntoScheduleConfigs<Box<dyn System<In = (), Out = ()>>, M>,
) -> &mut Schedules
pub fn add_systems<M>( &mut self, schedule: impl ScheduleLabel, systems: impl IntoScheduleConfigs<Box<dyn System<In = (), Out = ()>>, M>, ) -> &mut Schedules
Adds one or more systems to the Schedule matching the provided [ScheduleLabel].
pub fn remove_systems_in_set<M>(
&mut self,
schedule: impl ScheduleLabel,
set: impl IntoSystemSet<M>,
world: &mut World,
policy: ScheduleCleanupPolicy,
) -> Result<usize, ScheduleError>
pub fn remove_systems_in_set<M>( &mut self, schedule: impl ScheduleLabel, set: impl IntoSystemSet<M>, world: &mut World, policy: ScheduleCleanupPolicy, ) -> Result<usize, ScheduleError>
Removes all systems in a SystemSet. This will cause the schedule to be rebuilt when
the schedule is run again. A [ScheduleError] is returned if the schedule needs to be
Schedule::initialize’d or the set is not found.
pub fn configure_sets<M>(
&mut self,
schedule: impl ScheduleLabel,
sets: impl IntoScheduleConfigs<Interned<dyn SystemSet>, M>,
) -> &mut Schedules
pub fn configure_sets<M>( &mut self, schedule: impl ScheduleLabel, sets: impl IntoScheduleConfigs<Interned<dyn SystemSet>, M>, ) -> &mut Schedules
Configures a collection of system sets in the provided schedule, adding any sets that do not exist.
pub fn ignore_ambiguity<M1, M2, S1, S2>(
&mut self,
schedule: impl ScheduleLabel,
a: S1,
b: S2,
) -> &mut Scheduleswhere
S1: IntoSystemSet<M1>,
S2: IntoSystemSet<M2>,
pub fn ignore_ambiguity<M1, M2, S1, S2>(
&mut self,
schedule: impl ScheduleLabel,
a: S1,
b: S2,
) -> &mut Scheduleswhere
S1: IntoSystemSet<M1>,
S2: IntoSystemSet<M2>,
Suppress warnings and errors that would result from systems in these sets having ambiguities
(conflicting access but indeterminate order) with systems in set.
When possible, do this directly in the .add_systems(Update, a.ambiguous_with(b)) call.
However, sometimes two independent plugins A and B are reported as ambiguous, which you
can only suppress as the consumer of both.
Trait Implementations§
§impl Component for Schedules
impl Component for Schedules
§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::SparseSet
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::SparseSet
§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read more§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Schedules>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Schedules>>
ComponentRelationshipAccessor] required for working with relationships in dynamic contexts. Read more§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
§fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreimpl Resource for Schedules
Auto Trait Implementations§
impl Freeze for Schedules
impl !RefUnwindSafe for Schedules
impl Send for Schedules
impl Sync for Schedules
impl Unpin for Schedules
impl UnsafeUnpin for Schedules
impl !UnwindSafe for Schedules
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>
§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
§unsafe fn get_components(
ptr: MovingPtr<'_, C>,
func: &mut impl FnMut(StorageType, OwningPtr<'_>),
) -> <C as DynamicBundle>::Effect
unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect
§unsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().