Trait ScheduleBuildPass

Source
pub trait ScheduleBuildPass:
    Send
    + Sync
    + Debug
    + 'static {
    type EdgeOptions: 'static;

    // Required methods
    fn add_dependency(
        &mut self,
        from: NodeId,
        to: NodeId,
        options: Option<&Self::EdgeOptions>,
    );
    fn collapse_set(
        &mut self,
        set: NodeId,
        systems: &[NodeId],
        dependency_flattened: &DiGraph,
    ) -> impl Iterator<Item = (NodeId, NodeId)>;
    fn build(
        &mut self,
        world: &mut World,
        graph: &mut ScheduleGraph,
        dependency_flattened: &mut DiGraph,
    ) -> Result<(), ScheduleBuildError>;
}
Expand description

A pass for modular modification of the dependency graph.

Required Associated Types§

Source

type EdgeOptions: 'static

Custom options for dependencies between sets or systems.

Required Methods§

Source

fn add_dependency( &mut self, from: NodeId, to: NodeId, options: Option<&Self::EdgeOptions>, )

Called when a dependency between sets or systems was explicitly added to the graph.

Source

fn collapse_set( &mut self, set: NodeId, systems: &[NodeId], dependency_flattened: &DiGraph, ) -> impl Iterator<Item = (NodeId, NodeId)>

Called while flattening the dependency graph. For each set, this method is called with the systems associated with the set as well as an immutable reference to the current graph. Instead of modifying the graph directly, this method should return an iterator of edges to add to the graph.

Source

fn build( &mut self, world: &mut World, graph: &mut ScheduleGraph, dependency_flattened: &mut DiGraph, ) -> Result<(), ScheduleBuildError>

The implementation will be able to modify the ScheduleGraph here.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§