pub struct Node<T> {
pub value: T,
/* private fields */
}
Expand description
A wrapper around the values given to the SceneGraph. This struct includes the data on the relationships to other nodes, in addition to the value placed at the node.
Fields§
§value: T
The value contained within the node.
Implementations§
Source§impl<T> Node<T>
impl<T> Node<T>
Sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
Returns true if this node has children.
Sourcepub fn iter_direct_children<'a>(
&'a self,
sg: &'a SceneGraph<T>,
) -> SceneGraphChildIter<'a, T> ⓘ
pub fn iter_direct_children<'a>( &'a self, sg: &'a SceneGraph<T>, ) -> SceneGraphChildIter<'a, T> ⓘ
Iterate directly over only the direct children of parent_index
.
For example, given a graph:
ROOT:
A
B
C
D
using iter_direct_children
and passing in the parent_index
for A
will only yield B
and C
, not D
. For that kind of depth first traversal, using iter_on_node
.
Note: passing in a SceneGraph of a different kind than this node belongs to (but of the same type) will create logic errors or panics.
Trait Implementations§
Source§impl<T: Ord> Ord for Node<T>
impl<T: Ord> Ord for Node<T>
Source§impl<T: PartialOrd> PartialOrd for Node<T>
impl<T: PartialOrd> PartialOrd for Node<T>
impl<T: Copy> Copy for Node<T>
impl<T: Eq> Eq for Node<T>
impl<T> StructuralPartialEq for Node<T>
Auto Trait Implementations§
impl<T> Freeze for Node<T>where
T: Freeze,
impl<T> RefUnwindSafe for Node<T>where
T: RefUnwindSafe,
impl<T> Send for Node<T>where
T: Send,
impl<T> Sync for Node<T>where
T: Sync,
impl<T> Unpin for Node<T>where
T: Unpin,
impl<T> UnwindSafe for Node<T>where
T: UnwindSafe,
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