Derive extent forwarding for level-preserving passthroughs

This commit is contained in:
Dennis Kobert
2026-08-22 15:34:22 +00:00
parent 13cd718c90
commit 0b2aa3798a
9 changed files with 67 additions and 35 deletions
+5 -1
View File
@@ -99,7 +99,7 @@ fn frame_memo_extent(content: ExtentIn<'_>, level: LevelIn) -> GPoll<Extent> {
type MonitorValue = Arc<Mutex<Option<IORecord<CtxSnapshot, RecordCapture>>>>;
/// The Monitor node is used by the editor to access the data flowing through it.
#[node_macro::node(category(""), path(graphene_core::memo), serialize(serialize_monitor), properties("monitor_properties"))]
#[node_macro::node(category(""), path(graphene_core::memo), serialize(serialize_monitor), properties("monitor_properties"), extent(monitor_extent))]
fn monitor<'e>(
ctx: impl Ctx + DeriveCtx + ExtractAll + ExtractArena<'e> + InjectIndex + Copy,
#[data] io: MonitorValue,
@@ -126,6 +126,10 @@ fn monitor<'e>(
result
}
fn monitor_extent(content: ExtentIn<'_>, level: LevelIn) -> GPoll<Extent> {
content.at(level)
}
fn serialize_monitor(io: &MonitorValue) -> Option<Arc<dyn std::any::Any + Send + Sync>> {
let io = io.lock().unwrap();
io.as_ref().map(|io| Arc::new(io.clone()) as Arc<dyn std::any::Any + Send + Sync>)