Skip to content

[00251] Change ViewTree API from Box<dyn View> to Arc<dyn View>#10

Merged
rorychatt merged 1 commit intomainfrom
tendril/00251-ChangeViewTreeApiFromBoxToArc
Apr 16, 2026
Merged

[00251] Change ViewTree API from Box<dyn View> to Arc<dyn View>#10
rorychatt merged 1 commit intomainfrom
tendril/00251-ChangeViewTreeApiFromBoxToArc

Conversation

@rorychatt
Copy link
Copy Markdown
Contributor

Summary

Changed the ViewTree public API (new, insert, insert_with_id) and ChildViewEntry from accepting Box<dyn View> to Arc<dyn View>. This removes the internal Arc::from(box) conversion, making Arc ownership explicit to callers and avoiding double indirection. Updated all production and test callers from Box::new(...) to Arc::new(...).

API Changes

  • ViewTree::new(root_view: Box<dyn View>)ViewTree::new(root_view: Arc<dyn View>)
  • ViewTree::insert(&mut self, parent_id: ViewId, view: Box<dyn View>)ViewTree::insert(&mut self, parent_id: ViewId, view: Arc<dyn View>)
  • ViewTree::insert_with_id(&mut self, parent_id: ViewId, child_id: ViewId, view: Box<dyn View>)ViewTree::insert_with_id(&mut self, parent_id: ViewId, child_id: ViewId, view: Arc<dyn View>)
  • ChildViewEntry.view: Box<dyn View>ChildViewEntry.view: Arc<dyn View>

Files Modified

  • rusty/src/core/view_tree.rs — Changed method signatures and internal storage assignment; updated all test callers
  • rusty/src/core/runtime.rs — Updated Runtime::new and test callers to use Arc::new
  • rusty/src/views/view.rs — Changed ChildViewEntry.view type and child_view() construction site

Commits

  • 00c9807

@rorychatt rorychatt merged commit 788e5f7 into main Apr 16, 2026
1 check passed
@rorychatt rorychatt deleted the tendril/00251-ChangeViewTreeApiFromBoxToArc branch April 16, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant