Trait SceneGraphNode

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

Show 18 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>]; // 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>(&self) -> Option<&T> where T: Any { ... } fn component_mut<T>(&mut self) -> Option<&mut T> where T: Any { ... } fn has_component<T>(&self) -> bool where T: Any { ... }
}

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>]

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>(&self) -> Option<&T>
where T: Any,

Tries to borrow a component of given type.

Source

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

Tries to borrow a component of given type.

Source

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

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", so this trait is not object safe.

Implementors§