Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions lib/dal/src/workspace_snapshot/node_weight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ use crate::{
},
geometry_node_weight::GeometryNodeWeight,
secret_node_weight::SecretNodeWeight,
traits::SiVersionedNodeWeight,
traits::{
ExclusiveOutgoingEdges,
SiVersionedNodeWeight,
SplitCorrectExclusiveOutgoingEdge,
},
view_node_weight::ViewNodeWeight,
},
},
Expand Down Expand Up @@ -1324,8 +1328,9 @@ impl CorrectTransforms for NodeWeight {
Ok(self.correct_exclusive_outgoing_edges(workspace_snapshot_graph, updates))
}
}

impl CorrectExclusiveOutgoingEdge for NodeWeight {
impl CorrectExclusiveOutgoingEdge for NodeWeight {}
impl SplitCorrectExclusiveOutgoingEdge for NodeWeight {}
impl ExclusiveOutgoingEdges for NodeWeight {
fn exclusive_outgoing_edges(&self) -> &[EdgeWeightKindDiscriminants] {
match self {
NodeWeight::Action(weight) => weight.exclusive_outgoing_edges(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::{
node_weight::traits::{
CorrectExclusiveOutgoingEdge,
CorrectTransforms,
ExclusiveOutgoingEdges,
SiNodeWeight,
},
},
Expand Down Expand Up @@ -51,7 +52,9 @@ impl ApprovalRequirementDefinitionNodeWeightV1 {

impl CorrectTransforms for ApprovalRequirementDefinitionNodeWeightV1 {}

impl CorrectExclusiveOutgoingEdge for ApprovalRequirementDefinitionNodeWeightV1 {
impl CorrectExclusiveOutgoingEdge for ApprovalRequirementDefinitionNodeWeightV1 {}

impl ExclusiveOutgoingEdges for ApprovalRequirementDefinitionNodeWeightV1 {
fn exclusive_outgoing_edges(&self) -> &[crate::EdgeWeightKindDiscriminants] {
&[]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use crate::{
CorrectTransforms,
CorrectTransformsError,
CorrectTransformsResult,
ExclusiveOutgoingEdges,
SiNodeWeight,
},
},
Expand Down Expand Up @@ -207,7 +208,9 @@ impl CorrectTransforms for DiagramObjectNodeWeightV1 {
}
}

impl CorrectExclusiveOutgoingEdge for DiagramObjectNodeWeightV1 {
impl CorrectExclusiveOutgoingEdge for DiagramObjectNodeWeightV1 {}

impl ExclusiveOutgoingEdges for DiagramObjectNodeWeightV1 {
fn exclusive_outgoing_edges(&self) -> &[EdgeWeightKindDiscriminants] {
&[]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ use crate::{
CorrectTransforms,
CorrectTransformsError,
CorrectTransformsResult,
ExclusiveOutgoingEdges,
SiNodeWeight,
},
},
Expand Down Expand Up @@ -280,7 +281,9 @@ impl CorrectTransforms for GeometryNodeWeightV1 {
}
}

impl CorrectExclusiveOutgoingEdge for GeometryNodeWeightV1 {
impl CorrectExclusiveOutgoingEdge for GeometryNodeWeightV1 {}

impl ExclusiveOutgoingEdges for GeometryNodeWeightV1 {
fn exclusive_outgoing_edges(&self) -> &[EdgeWeightKindDiscriminants] {
&[EdgeWeightKindDiscriminants::Represents]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use crate::{
traits::{
CorrectExclusiveOutgoingEdge,
CorrectTransforms,
ExclusiveOutgoingEdges,
SiNodeWeight,
},
},
Expand Down Expand Up @@ -62,7 +63,9 @@ impl InputSocketNodeWeightV1 {

impl CorrectTransforms for InputSocketNodeWeightV1 {}

impl CorrectExclusiveOutgoingEdge for InputSocketNodeWeightV1 {
impl CorrectExclusiveOutgoingEdge for InputSocketNodeWeightV1 {}

impl ExclusiveOutgoingEdges for InputSocketNodeWeightV1 {
fn exclusive_outgoing_edges(&self) -> &[EdgeWeightKindDiscriminants] {
&[]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::{
node_weight::traits::{
CorrectExclusiveOutgoingEdge,
CorrectTransforms,
ExclusiveOutgoingEdges,
SiNodeWeight,
},
},
Expand Down Expand Up @@ -89,7 +90,8 @@ impl SiNodeWeight for ManagementPrototypeNodeWeightV1 {
}

impl CorrectTransforms for ManagementPrototypeNodeWeightV1 {}
impl CorrectExclusiveOutgoingEdge for ManagementPrototypeNodeWeightV1 {
impl CorrectExclusiveOutgoingEdge for ManagementPrototypeNodeWeightV1 {}
impl ExclusiveOutgoingEdges for ManagementPrototypeNodeWeightV1 {
fn exclusive_outgoing_edges(&self) -> &[crate::EdgeWeightKindDiscriminants] {
&[]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::{
node_weight::traits::{
CorrectExclusiveOutgoingEdge,
CorrectTransforms,
ExclusiveOutgoingEdges,
SiNodeWeight,
},
},
Expand Down Expand Up @@ -45,8 +46,8 @@ impl ReasonNodeWeightV1 {
}

impl CorrectTransforms for ReasonNodeWeightV1 {}

impl CorrectExclusiveOutgoingEdge for ReasonNodeWeightV1 {
impl CorrectExclusiveOutgoingEdge for ReasonNodeWeightV1 {}
impl ExclusiveOutgoingEdges for ReasonNodeWeightV1 {
fn exclusive_outgoing_edges(&self) -> &[crate::EdgeWeightKindDiscriminants] {
&[]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ use crate::{
traits::{
CorrectExclusiveOutgoingEdge,
CorrectTransforms,
ExclusiveOutgoingEdges,
SiNodeWeight,
},
},
Expand Down Expand Up @@ -568,8 +569,8 @@ impl CorrectTransforms for SchemaVariantNodeWeightV1 {
Ok(updates)
}
}

impl CorrectExclusiveOutgoingEdge for SchemaVariantNodeWeightV1 {
impl CorrectExclusiveOutgoingEdge for SchemaVariantNodeWeightV1 {}
impl ExclusiveOutgoingEdges for SchemaVariantNodeWeightV1 {
fn exclusive_outgoing_edges(&self) -> &[EdgeWeightKindDiscriminants] {
&[]
}
Expand Down
16 changes: 14 additions & 2 deletions lib/dal/src/workspace_snapshot/node_weight/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ use crate::{

pub mod correct_exclusive_outgoing_edge;

pub use correct_exclusive_outgoing_edge::CorrectExclusiveOutgoingEdge;
pub use correct_exclusive_outgoing_edge::{
CorrectExclusiveOutgoingEdge,
ExclusiveOutgoingEdges,
SplitCorrectExclusiveOutgoingEdge,
};

#[remain::sorted]
#[derive(Debug, Error)]
Expand Down Expand Up @@ -51,7 +55,9 @@ pub trait CorrectTransforms {
}
}

pub trait SiNodeWeight: CorrectTransforms + CorrectExclusiveOutgoingEdge + Sized {
pub trait SiNodeWeight:
CorrectTransforms + CorrectExclusiveOutgoingEdge + ExclusiveOutgoingEdges + Sized
{
fn content_hash(&self) -> ContentHash;
fn id(&self) -> Ulid;
fn lineage_id(&self) -> Ulid;
Expand Down Expand Up @@ -184,6 +190,12 @@ impl<T> CorrectExclusiveOutgoingEdge for T
where
T: SiVersionedNodeWeight,
NodeInformation: for<'a> From<&'a T>,
{
}

impl<T> ExclusiveOutgoingEdges for T
where
T: SiVersionedNodeWeight,
{
fn exclusive_outgoing_edges(&self) -> &[EdgeWeightKindDiscriminants] {
self.inner().exclusive_outgoing_edges()
Expand Down
Loading