Struct bevy::ecs::schedule::ScheduleGraph
pub struct ScheduleGraph { /* private fields */ }
Expand description
Metadata for a Schedule
.
Implementations§
§impl ScheduleGraph
impl ScheduleGraph
pub fn new() -> ScheduleGraph
pub fn new() -> ScheduleGraph
Creates an empty ScheduleGraph
with default settings.
pub fn get_system_at(
&self,
id: NodeId
) -> Option<&(dyn System<Out = (), In = ()> + 'static)>
pub fn get_system_at( &self, id: NodeId ) -> Option<&(dyn System<Out = (), In = ()> + 'static)>
Returns the system at the given NodeId
, if it exists.
pub fn system_at(
&self,
id: NodeId
) -> &(dyn System<Out = (), In = ()> + 'static)
pub fn system_at( &self, id: NodeId ) -> &(dyn System<Out = (), In = ()> + 'static)
Returns the system at the given NodeId
.
Panics if it doesn’t exist.
pub fn get_set_at(&self, id: NodeId) -> Option<&(dyn SystemSet + 'static)>
pub fn get_set_at(&self, id: NodeId) -> Option<&(dyn SystemSet + 'static)>
Returns the set at the given NodeId
, if it exists.
pub fn set_at(&self, id: NodeId) -> &(dyn SystemSet + 'static)
pub fn set_at(&self, id: NodeId) -> &(dyn SystemSet + 'static)
Returns the set at the given NodeId
.
Panics if it doesn’t exist.
pub fn systems(
&self
) -> impl Iterator<Item = (NodeId, &(dyn System<Out = (), In = ()> + 'static), &[Box<dyn ReadOnlySystem<Out = bool, In = ()>, Global>])>
pub fn systems( &self ) -> impl Iterator<Item = (NodeId, &(dyn System<Out = (), In = ()> + 'static), &[Box<dyn ReadOnlySystem<Out = bool, In = ()>, Global>])>
Returns an iterator over all systems in this schedule.
pub fn system_sets(
&self
) -> impl Iterator<Item = (NodeId, &(dyn SystemSet + 'static), &[Box<dyn ReadOnlySystem<Out = bool, In = ()>, Global>])>
pub fn system_sets( &self ) -> impl Iterator<Item = (NodeId, &(dyn SystemSet + 'static), &[Box<dyn ReadOnlySystem<Out = bool, In = ()>, Global>])>
Returns an iterator over all system sets in this schedule.
pub fn hierarchy(&self) -> &Dag
pub fn hierarchy(&self) -> &Dag
Returns the Dag
of the hierarchy.
The hierarchy is a directed acyclic graph of the systems and sets, where an edge denotes that a system or set is the child of another set.
pub fn dependency(&self) -> &Dag
pub fn dependency(&self) -> &Dag
Returns the Dag
of the dependencies in the schedule.
Nodes in this graph are systems and sets, and edges denote that a system or set has to run before another system or set.
pub fn conflicting_systems(
&self
) -> &[(NodeId, NodeId, Vec<ComponentId, Global>)]
pub fn conflicting_systems( &self ) -> &[(NodeId, NodeId, Vec<ComponentId, Global>)]
Returns the list of systems that conflict with each other, i.e. have ambiguities in their access.
If the Vec<ComponentId>
is empty, the systems conflict on World
access.
Must be called after ScheduleGraph::build_schedule
to be non-empty.
pub fn initialize(&mut self, world: &mut World)
pub fn initialize(&mut self, world: &mut World)
Initializes any newly-added systems and conditions by calling System::initialize
pub fn build_schedule(
&mut self,
components: &Components,
schedule_label: Interned<dyn ScheduleLabel>,
ignored_ambiguities: &BTreeSet<ComponentId, Global>
) -> Result<SystemSchedule, ScheduleBuildError>
pub fn build_schedule( &mut self, components: &Components, schedule_label: Interned<dyn ScheduleLabel>, ignored_ambiguities: &BTreeSet<ComponentId, Global> ) -> Result<SystemSchedule, ScheduleBuildError>
Build a SystemSchedule
optimized for scheduler access from the ScheduleGraph
.
This method also
- checks for dependency or hierarchy cycles
- checks for system access conflicts and reports ambiguities
§impl ScheduleGraph
impl ScheduleGraph
pub fn conflicts_to_string<'a>(
&'a self,
ambiguities: &'a [(NodeId, NodeId, Vec<ComponentId, Global>)],
components: &'a Components
) -> impl Iterator<Item = (String, String, Vec<&'a str, Global>)> + 'a
pub fn conflicts_to_string<'a>( &'a self, ambiguities: &'a [(NodeId, NodeId, Vec<ComponentId, Global>)], components: &'a Components ) -> impl Iterator<Item = (String, String, Vec<&'a str, Global>)> + 'a
convert conflicts to human readable format
Trait Implementations§
§impl Default for ScheduleGraph
impl Default for ScheduleGraph
§fn default() -> ScheduleGraph
fn default() -> ScheduleGraph
Auto Trait Implementations§
impl !RefUnwindSafe for ScheduleGraph
impl Send for ScheduleGraph
impl Sync for ScheduleGraph
impl Unpin for ScheduleGraph
impl !UnwindSafe for ScheduleGraph
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere U: ShaderType, &'a T: for<'a> Into<U>,
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§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
Self
using data from the given World
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere R: Read + ReadEndian<P>, P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.