diff --git a/node-graph/graph-craft/src/document/value.rs b/node-graph/graph-craft/src/document/value.rs index 83041d5d53..46990ee5bd 100644 --- a/node-graph/graph-craft/src/document/value.rs +++ b/node-graph/graph-craft/src/document/value.rs @@ -10,7 +10,7 @@ use core_types::list::List; use core_types::registry::SourceHandle; use core_types::transform::Footprint; use core_types::uuid::NodeId; -use core_types::value::{leveled_record_value_edge, record_value_edge}; +use core_types::value::{leveled_record_value_edge, record_value_source}; use core_types::{CacheHash, Color, ContextModification, MemoHash, Type, TypeDescriptor}; use dyn_any::DynAny; pub use dyn_any::StaticType; @@ -315,7 +315,7 @@ macro_rules! tagged_value { // =============== // MANUAL VARIANTS // =============== - Self::None => Ok(record_value_edge(())), + Self::None => Ok(record_value_source(())), Self::TypeDefault(td) => { let name = td.name.as_ref(); // The list-typed defaults serve an empty level; the rest construct @@ -334,8 +334,8 @@ macro_rules! tagged_value { // starts from a blank vector, as the legacy path modify synthesized itself. if name == core_types::normalize_type_name(std::any::type_name::>()) { return Ok(leveled_record_value_edge(vec![Vector::default()])); } check_level!(List, String); - if name == core_types::normalize_type_name(std::any::type_name::()) { return Ok(record_value_edge(DocumentNode::default())); } - if name == core_types::normalize_type_name(std::any::type_name::()) { return Ok(record_value_edge(Resource::default())); } + if name == core_types::normalize_type_name(std::any::type_name::()) { return Ok(record_value_source(DocumentNode::default())); } + if name == core_types::normalize_type_name(std::any::type_name::()) { return Ok(record_value_source(Resource::default())); } Self::from_type_or_none(&Type::Concrete(td)).to_edge() } Self::F64Array(values) => Ok(leveled_record_value_edge(values)), @@ -345,16 +345,16 @@ macro_rules! tagged_value { // ======================= // AUTO-GENERATED VARIANTS // ======================= - $( Self::$identifier(x) => Ok(record_value_edge(x)), )* + $( Self::$identifier(x) => Ok(record_value_source(x)), )* // ======================= // NON-SERIALIZED VARIANTS // ======================= - Self::RenderOutput(x) => Ok(record_value_edge(x)), - Self::NodeIdPath(path) => Ok(record_value_edge(path)), - Self::DocumentNode(node) => Ok(record_value_edge(node)), - Self::ContextModification(modification) => Ok(record_value_edge(modification)), - Self::EditorApi(x) => Ok(record_value_edge(x)), - Self::ResourceHash(x) => Ok(record_value_edge(x)), + Self::RenderOutput(x) => Ok(record_value_source(x)), + Self::NodeIdPath(path) => Ok(record_value_source(path)), + Self::DocumentNode(node) => Ok(record_value_source(node)), + Self::ContextModification(modification) => Ok(record_value_source(modification)), + Self::EditorApi(x) => Ok(record_value_source(x)), + Self::ResourceHash(x) => Ok(record_value_source(x)), } } diff --git a/node-graph/libraries/core-types/src/registry.rs b/node-graph/libraries/core-types/src/registry.rs index 2e34f8e00c..15b12b10a5 100644 --- a/node-graph/libraries/core-types/src/registry.rs +++ b/node-graph/libraries/core-types/src/registry.rs @@ -555,7 +555,7 @@ mod tests { let mut args = args.into_iter(); let value = args.next().ok_or(ConstructionError::Arity { expected: 1, got: 0 })?.downcast_record::()?; drop(value); - Ok(crate::value::record_value_edge(0u32)) + Ok(crate::value::record_value_source(0u32)) } let entry = RegistryEntry { layout_meta: None, @@ -563,12 +563,12 @@ mod tests { constructor: construct_strlen, }; - let owned = crate::value::record_value_edge("typed".to_string()); + let owned = crate::value::record_value_source("typed".to_string()); assert!(construct(&entry, vec![owned]).is_ok()); assert_eq!(construct(&entry, vec![]).unwrap_err(), ConstructionError::Arity { expected: 1, got: 0 }); - let mistyped = crate::value::record_value_edge(1.0f64); + let mistyped = crate::value::record_value_source(1.0f64); assert_eq!( construct(&entry, vec![mistyped]).unwrap_err(), ConstructionError::Type { diff --git a/node-graph/libraries/core-types/src/value.rs b/node-graph/libraries/core-types/src/value.rs index 047f089c1c..ee9157249e 100644 --- a/node-graph/libraries/core-types/src/value.rs +++ b/node-graph/libraries/core-types/src/value.rs @@ -33,8 +33,8 @@ where } } -/// The native record edge of a constant. -pub fn record_value_edge(value: T) -> crate::registry::SourceHandle +/// The native record source of a constant. +pub fn record_value_source(value: T) -> crate::registry::SourceHandle where T::Static: Clone + Send + Sync, { diff --git a/node-graph/nodes/math/src/lib.rs b/node-graph/nodes/math/src/lib.rs index a569f95ba8..4dd312c974 100644 --- a/node-graph/nodes/math/src/lib.rs +++ b/node-graph/nodes/math/src/lib.rs @@ -1016,7 +1016,7 @@ mod graphene_test { use core_types::node::{BatchStatus, Node}; use core_types::record::{Layout, LiftedSource, RecordValue, serve_input}; use core_types::registry::{ErasedRecordNode, construct}; - use core_types::value::record_value_edge; + use core_types::value::record_value_source; use std::mem::MaybeUninit; fn scope_fixture(arena: &Arena) -> EvalScope<'_> { @@ -1111,7 +1111,7 @@ mod graphene_test { let ctx = ContextImpl::root(&scope); let entries = super::_logical_or_mod::logical_or_entries(); - let mut wired = construct(&entries[0], vec![record_value_edge(true), record_value_edge(false)]).unwrap(); + let mut wired = construct(&entries[0], vec![record_value_source(true), record_value_source(false)]).unwrap(); let layout = out_layout::(); wired.set_layout(core_types::record::RecordLayout { frame_bytes: layout.frame_bytes(), @@ -1157,7 +1157,7 @@ mod graphene_test { ); assert_eq!(entries[3].io.return_value, core_types::registry::record_type::()); - let mut wired = construct(&entries[0], vec![record_value_edge(1.5f64), record_value_edge(2.5f64)]).unwrap(); + let mut wired = construct(&entries[0], vec![record_value_source(1.5f64), record_value_source(2.5f64)]).unwrap(); let layout = out_layout::(); wired.set_layout(core_types::record::RecordLayout { frame_bytes: layout.frame_bytes(),