Skip to content

Commit fdba8cb

Browse files
Move TaggedValue::ResourceHash to macro definition site
1 parent d90a49a commit fdba8cb

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • node-graph/graph-craft/src/document

node-graph/graph-craft/src/document/value.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ macro_rules! tagged_value {
9090
ContextFeatures(ContextFeatures),
9191
#[serde(skip)]
9292
EditorApi(Arc<PlatformEditorApi>),
93+
/// Only used by the `resource` node, should never be serialized
94+
#[serde(skip)]
95+
ResourceHash(graphene_application_io::resource::ResourceHash),
9396
}
9497

9598
impl CacheHash for TaggedValue {
@@ -117,6 +120,7 @@ macro_rules! tagged_value {
117120
Self::ContextFeatures(features) => features.cache_hash(state),
118121
Self::RenderOutput(x) => x.cache_hash(state),
119122
Self::EditorApi(x) => x.cache_hash(state),
123+
Self::ResourceHash(x) => x.cache_hash(state),
120124
}
121125
}
122126
}
@@ -170,6 +174,7 @@ macro_rules! tagged_value {
170174
Self::DocumentNode(node) => Box::new(node),
171175
Self::ContextFeatures(features) => Box::new(features),
172176
Self::EditorApi(x) => Box::new(x),
177+
Self::ResourceHash(x) => Box::new(x),
173178
}
174179
}
175180

@@ -219,6 +224,7 @@ macro_rules! tagged_value {
219224
Self::DocumentNode(node) => Arc::new(node),
220225
Self::ContextFeatures(features) => Arc::new(features),
221226
Self::EditorApi(x) => Arc::new(x),
227+
Self::ResourceHash(x) => Arc::new(x),
222228
}
223229
}
224230

@@ -246,6 +252,7 @@ macro_rules! tagged_value {
246252
Self::DocumentNode(_) => concrete!(DocumentNode),
247253
Self::ContextFeatures(_) => concrete!(ContextFeatures),
248254
Self::EditorApi(_) => concrete!(&PlatformEditorApi),
255+
Self::ResourceHash(_) => concrete!(graphene_application_io::resource::ResourceHash),
249256
}
250257
}
251258

@@ -351,6 +358,7 @@ macro_rules! tagged_value {
351358
Self::DocumentNode(node) => format!("DocumentNode({node:?})"),
352359
Self::ContextFeatures(features) => format!("ContextFeatures({features:?})"),
353360
Self::EditorApi(_) => "PlatformEditorApi".to_string(),
361+
Self::ResourceHash(hash) => format!("ResourceHash({hash:?})"),
354362
}
355363
}
356364
}
@@ -397,7 +405,6 @@ tagged_value! {
397405
VectorModification(Box<VectorModification>),
398406
ImageData(Image<Color>),
399407
Resource(graphene_application_io::resource::ResourceId),
400-
ResourceHash(graphene_application_io::resource::ResourceHash),
401408
// ==========
402409
// ENUM TYPES
403410
// ==========

0 commit comments

Comments
 (0)