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§
type Base: Clone
type SceneGraph: SceneGraph<Node = Self>
type ResourceData: PrefabData<Graph = Self::SceneGraph>
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§
Sourcefn swap_child_position(
&mut self,
child: Handle<Self>,
pos: usize,
) -> Option<usize>
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.
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>>
Sourcefn component_ref<T>(&self) -> Option<&T>where
T: Any,
fn component_ref<T>(&self) -> Option<&T>where
T: Any,
Tries to borrow a component of given type.
Sourcefn component_mut<T>(&mut self) -> Option<&mut T>where
T: Any,
fn component_mut<T>(&mut self) -> Option<&mut T>where
T: Any,
Tries to borrow a component of given type.
Sourcefn has_component<T>(&self) -> boolwhere
T: Any,
fn has_component<T>(&self) -> boolwhere
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.