From 26d4e48480f22589e5e13a48953d4a853b2d7f7d Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Fri, 25 Nov 2022 11:45:47 -0600 Subject: [PATCH] make resolve passes public --- packages/native-core/src/tree.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/native-core/src/tree.rs b/packages/native-core/src/tree.rs index f4ad67f2e..f5b4c09bf 100644 --- a/packages/native-core/src/tree.rs +++ b/packages/native-core/src/tree.rs @@ -829,23 +829,17 @@ fn traverse_breadth_first() { }); } -enum PassDirection { - Up, - Down, - Node, -} - #[derive(PartialEq, Eq, Hash, Clone, Copy)] -struct PassId(u64); +pub struct PassId(u64); -trait UpwardPass { +pub trait UpwardPass { fn pass_id(&self) -> PassId; fn dependancies(&self) -> &'static [PassId]; fn dependants(&self) -> &'static [PassId]; fn upward_pass(&self, node: &mut T, parent: Option<&mut T>) -> bool; } -trait DownwardPass { +pub trait DownwardPass { fn pass_id(&self) -> PassId; fn dependancies(&self) -> &'static [PassId]; fn dependants(&self) -> &'static [PassId]; @@ -856,14 +850,14 @@ trait DownwardPass { ) -> bool; } -trait NodePass { +pub trait NodePass { fn pass_id(&self) -> PassId; fn dependancies(&self) -> &'static [PassId]; fn dependants(&self) -> &'static [PassId]; fn node_pass(&self, node: &mut T) -> bool; } -enum AnyPass { +pub enum AnyPass { Upward(Box + Send + Sync>), Downward(Box + Send + Sync>), Node(Box + Send + Sync>), @@ -954,7 +948,7 @@ impl DirtyNodeStates { } } -fn resolve_passes( +pub fn resolve_passes( tree: &mut impl TreeView, starting_nodes: FxHashMap>, mut passes: Vec>,