pub struct NodeTree { /* private fields */ }Expand description
The scene tree. Owns all nodes; dropping a subtree drops its scripts.
Implementations§
Source§impl NodeTree
impl NodeTree
pub fn new() -> Self
Sourcepub fn insert(&mut self, desc: NodeDesc) -> Result<()>
pub fn insert(&mut self, desc: NodeDesc) -> Result<()>
Insert a node record. Parent linkage is best-effort: unknown parents
are reported by pite-scene::validate, never a load failure.
pub fn get(&self, id: &NodeId) -> Option<&Node>
pub fn contains(&self, id: &NodeId) -> bool
pub fn children_of(&self, id: &NodeId) -> Vec<NodeId>
pub fn get_mut(&mut self, id: &NodeId) -> Option<&mut Node>
pub fn iter(&self) -> impl Iterator<Item = &Node>
pub fn root(&self) -> Option<&NodeId>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn remove(&mut self, id: &NodeId) -> Result<()>
pub fn reparent( &mut self, id: &NodeId, new_parent: Option<NodeId>, ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NodeTree
impl RefUnwindSafe for NodeTree
impl Send for NodeTree
impl Sync for NodeTree
impl Unpin for NodeTree
impl UnsafeUnpin for NodeTree
impl UnwindSafe for NodeTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more