Skip to main content

SceneGraphNode

Trait SceneGraphNode 

Source
pub trait SceneGraphNode:
    ComponentProvider
    + Reflect
    + NameProvider
    + Clone
    + 'static {
    type Base: Clone;
    type SceneGraph: SceneGraph<Node = Self>;
    type ResourceData: PrefabData<Graph = Self::SceneGraph>;

Show 19 methods // Required methods fn base(&self) -> &Self::Base; fn set_base(&mut self, base: Self::Base); fn is_resource_instance_root(&self) -> bool; fn original_handle_in_resource(&self) -> Handle<Self>; fn set_original_handle_in_resource(&mut self, handle: Handle<Self>); fn resource(&self) -> Option<Resource<Self::ResourceData>>; fn self_handle(&self) -> Handle<Self>; fn parent(&self) -> Handle<Self>; fn children(&self) -> &[Handle<Self>]; fn children_mut(&mut self) -> &mut [Handle<Self>]; fn instance_id(&self) -> Uuid; // Provided methods fn swap_child_position( &mut self, child: Handle<Self>, pos: usize, ) -> Option<usize> { ... } fn set_child_position( &mut self, child: Handle<Self>, dest_pos: usize, ) -> Option<usize> { ... } fn child_position(&self, child: Handle<Self>) -> Option<usize> { ... } fn has_child(&self, child: Handle<Self>) -> bool { ... } fn revert_inheritable_property( &mut self, path: &str, ) -> Option<Box<dyn Reflect>> { ... } fn component_ref<T: Any>(&self) -> Option<&T> { ... } fn component_mut<T: Any>(&mut self) -> Option<&mut T> { ... } fn has_component<T: Any>(&self) -> bool { ... }
}

Required Associated Types§

Required Methods§

Source

fn base(&self) -> &Self::Base

Source

fn set_base(&mut self, base: Self::Base)

Source

fn is_resource_instance_root(&self) -> bool

Source

fn original_handle_in_resource(&self) -> Handle<Self>

Source

fn set_original_handle_in_resource(&mut self, handle: Handle<Self>)

Source

fn resource(&self) -> Option<Resource<Self::ResourceData>>

Source

fn self_handle(&self) -> Handle<Self>

Source

fn parent(&self) -> Handle<Self>

Source

fn children(&self) -> &[Handle<Self>]

Source

fn children_mut(&mut self) -> &mut [Handle<Self>]

Source

fn instance_id(&self) -> Uuid

Provided Methods§

Source

fn swap_child_position( &mut self, child: Handle<Self>, pos: usize, ) -> Option<usize>

Puts the given child handle to the given position pos, by swapping positions.

Source

fn set_child_position( &mut self, child: Handle<Self>, dest_pos: usize, ) -> Option<usize>

Source

fn child_position(&self, child: Handle<Self>) -> Option<usize>

Source

fn has_child(&self, child: Handle<Self>) -> bool

Source

fn revert_inheritable_property( &mut self, path: &str, ) -> Option<Box<dyn Reflect>>

Source

fn component_ref<T: Any>(&self) -> Option<&T>

Tries to borrow a component of given type.

Source

fn component_mut<T: Any>(&mut self) -> Option<&mut T>

Tries to borrow a component of given type.

Source

fn has_component<T: Any>(&self) -> bool

Checks if the node has a component of given type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§