pub struct Node(/* private fields */);
Expand description
Node is the basic building block for 3D scenes. It has multiple variants, but all of them share some common functionality:
- Local and global transform
- Info about connections with other nodes in scene
- Visibility state - local and global
- Name and tags
- Level of details
- Physics binding mode
The exact functionality depends on variant of the node, check the respective docs for a variant you interested in.
§Hierarchy
Nodes can be connected with other nodes, so a child node will be moved/rotate/scaled together with parent node. This has some analogy in real world - imagine a pen with a cap. The pen will be the parent node in the hierarchy and the cap will be child node. When you moving the pen, the cap moves with it only if it attached to the pen. The same principle works with scene nodes.
§Transform
The node has two kinds of transform - local and global. Local transform defines where the node is located (translation) relative to origin, how much it is scaled (in percent) and rotated (around any arbitrary axis). Global transform is almost the same, but it also includes the whole chain of transforms of parent nodes. In the previous example with the pen, the cap has its own local transform which tells how much it should be moved from origin to be exactly on top of the pen. But global transform of the cap includes transform of the pen. So if you move the pen, the local transform of the cap will remain the same, but global transform will include the transform of the pen.
§Name and tag
The node can have arbitrary name and tag. Both could be used to search the node in the graph. Unlike the name,
tag could be used to store some gameplay information about the node. For example you can place a Mesh
node
that represents health pack model and it will have a name “HealthPack”, in the tag you could put additional info
like “MediumPack”, “SmallPack”, etc. So 3D model will not have “garbage” in its name, it will be stored inside tag.
§Visibility
The now has two kinds of visibility - local and global. As with transform, everything here is pretty similar. Local visibility defines if the node is visible as if it would be rendered alone, global visibility includes the combined visibility of entire chain of parent nodes.
Please keep in mind that “visibility” here means some sort of a “switch” that tells the renderer whether to draw the node or not.
§Level of details
The node could control which children nodes should be drawn based on the distance to a camera, this is so called level of detail functionality. There is a separate article about LODs, it can be found here.
§Property inheritance
Property inheritance is used to propagate changes of unmodified properties from a prefab to its instances. For example, you can change scale of a node in a prefab and its instances will have the same scale too, unless the scale is set explicitly in an instance. Such feature allows you to tweak instances, add some unique details to them, but take general properties from parent prefabs.
§Important notes
Property inheritance uses variable::InheritableVariable
to wrap actual property value, such wrapper stores a tiny
bitfield for flags that can tell whether or not the property was modified. Property inheritance system is then uses
reflection to “walk” over each property in the node and respective parent resource (from which the node was instantiated from,
if any) and checks if the property was modified. If it was modified, its value remains the same, otherwise the value
from the respective property in a “parent” node in the parent resource is copied to the property of the node. Such
process is then repeated for all levels of inheritance, starting from the root and going down to children in inheritance
hierarchy.
The most important thing is that variable::InheritableVariable
will save (serialize) its value only if it was marked
as modified (we don’t need to save anything if it can be fetched from parent). This saves a lot of disk space for
inherited assets (in some extreme cases memory consumption can be reduced by 90%, if there’s only few properties modified).
This fact requires “root” (nodes that are not instances) nodes to have all inheritable properties to be marked as
modified, otherwise their values won’t be saved, which is indeed wrong.
When a node is instantiated from some model resource, all its properties become non-modified. Which allows the inheritance system to correctly handle redundant information.
Such implementation of property inheritance has its drawbacks, major one is: each instance still holds its own copy of of every field, even those inheritable variables which are non-modified. Which means that there’s no benefits of RAM consumption, only disk space usage is reduced.
Implementations§
Source§impl Node
impl Node
Sourcepub fn new<T: NodeTrait>(node: T) -> Self
pub fn new<T: NodeTrait>(node: T) -> Self
Creates a new node instance from any type that implements NodeTrait
.
Sourcepub fn cast<T: NodeTrait>(&self) -> Option<&T>
pub fn cast<T: NodeTrait>(&self) -> Option<&T>
Performs downcasting to a particular type.
§Example
fn node_as_mesh_ref(node: &Node) -> &Mesh {
node.cast::<Mesh>().expect("Expected to be an instance of Mesh")
}
Sourcepub fn cast_mut<T: NodeTrait>(&mut self) -> Option<&mut T>
pub fn cast_mut<T: NodeTrait>(&mut self) -> Option<&mut T>
Performs downcasting to a particular type.
§Example
fn node_as_mesh_mut(node: &mut Node) -> &mut Mesh {
node.cast_mut::<Mesh>().expect("Expected to be an instance of Mesh")
}
Sourcepub fn as_mesh(&self) -> &Mesh
pub fn as_mesh(&self) -> &Mesh
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_mesh_mut(&mut self) -> &mut Mesh
pub fn as_mesh_mut(&mut self) -> &mut Mesh
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_pivot(&self) -> &Pivot
pub fn as_pivot(&self) -> &Pivot
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_pivot_mut(&mut self) -> &mut Pivot
pub fn as_pivot_mut(&mut self) -> &mut Pivot
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_camera(&self) -> &Camera
pub fn as_camera(&self) -> &Camera
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_camera_mut(&mut self) -> &mut Camera
pub fn as_camera_mut(&mut self) -> &mut Camera
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn is_spot_light(&self) -> bool
pub fn is_spot_light(&self) -> bool
Returns true if node is instance of given type.
Sourcepub fn as_spot_light(&self) -> &SpotLight
pub fn as_spot_light(&self) -> &SpotLight
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_spot_light_mut(&mut self) -> &mut SpotLight
pub fn as_spot_light_mut(&mut self) -> &mut SpotLight
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn is_point_light(&self) -> bool
pub fn is_point_light(&self) -> bool
Returns true if node is instance of given type.
Sourcepub fn as_point_light(&self) -> &PointLight
pub fn as_point_light(&self) -> &PointLight
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_point_light_mut(&mut self) -> &mut PointLight
pub fn as_point_light_mut(&mut self) -> &mut PointLight
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn is_directional_light(&self) -> bool
pub fn is_directional_light(&self) -> bool
Returns true if node is instance of given type.
Sourcepub fn as_directional_light(&self) -> &DirectionalLight
pub fn as_directional_light(&self) -> &DirectionalLight
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_directional_light_mut(&mut self) -> &mut DirectionalLight
pub fn as_directional_light_mut(&mut self) -> &mut DirectionalLight
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn is_particle_system(&self) -> bool
pub fn is_particle_system(&self) -> bool
Returns true if node is instance of given type.
Sourcepub fn as_particle_system(&self) -> &ParticleSystem
pub fn as_particle_system(&self) -> &ParticleSystem
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_particle_system_mut(&mut self) -> &mut ParticleSystem
pub fn as_particle_system_mut(&mut self) -> &mut ParticleSystem
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_sprite(&self) -> &Sprite
pub fn as_sprite(&self) -> &Sprite
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_sprite_mut(&mut self) -> &mut Sprite
pub fn as_sprite_mut(&mut self) -> &mut Sprite
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn is_terrain(&self) -> bool
pub fn is_terrain(&self) -> bool
Returns true if node is instance of given type.
Sourcepub fn as_terrain(&self) -> &Terrain
pub fn as_terrain(&self) -> &Terrain
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_terrain_mut(&mut self) -> &mut Terrain
pub fn as_terrain_mut(&mut self) -> &mut Terrain
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_decal(&self) -> &Decal
pub fn as_decal(&self) -> &Decal
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_decal_mut(&mut self) -> &mut Decal
pub fn as_decal_mut(&mut self) -> &mut Decal
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn is_rectangle(&self) -> bool
pub fn is_rectangle(&self) -> bool
Returns true if node is instance of given type.
Sourcepub fn as_rectangle(&self) -> &Rectangle
pub fn as_rectangle(&self) -> &Rectangle
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_rectangle_mut(&mut self) -> &mut Rectangle
pub fn as_rectangle_mut(&mut self) -> &mut Rectangle
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn is_rigid_body(&self) -> bool
pub fn is_rigid_body(&self) -> bool
Returns true if node is instance of given type.
Sourcepub fn as_rigid_body(&self) -> &RigidBody
pub fn as_rigid_body(&self) -> &RigidBody
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_rigid_body_mut(&mut self) -> &mut RigidBody
pub fn as_rigid_body_mut(&mut self) -> &mut RigidBody
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn is_collider(&self) -> bool
pub fn is_collider(&self) -> bool
Returns true if node is instance of given type.
Sourcepub fn as_collider(&self) -> &Collider
pub fn as_collider(&self) -> &Collider
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_collider_mut(&mut self) -> &mut Collider
pub fn as_collider_mut(&mut self) -> &mut Collider
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_joint(&self) -> &Joint
pub fn as_joint(&self) -> &Joint
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_joint_mut(&mut self) -> &mut Joint
pub fn as_joint_mut(&mut self) -> &mut Joint
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn is_rigid_body2d(&self) -> bool
pub fn is_rigid_body2d(&self) -> bool
Returns true if node is instance of given type.
Sourcepub fn as_rigid_body2d(&self) -> &RigidBody
pub fn as_rigid_body2d(&self) -> &RigidBody
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_rigid_body2d_mut(&mut self) -> &mut RigidBody
pub fn as_rigid_body2d_mut(&mut self) -> &mut RigidBody
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn is_collider2d(&self) -> bool
pub fn is_collider2d(&self) -> bool
Returns true if node is instance of given type.
Sourcepub fn as_collider2d(&self) -> &Collider
pub fn as_collider2d(&self) -> &Collider
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_collider2d_mut(&mut self) -> &mut Collider
pub fn as_collider2d_mut(&mut self) -> &mut Collider
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn is_joint2d(&self) -> bool
pub fn is_joint2d(&self) -> bool
Returns true if node is instance of given type.
Sourcepub fn as_joint2d(&self) -> &Joint
pub fn as_joint2d(&self) -> &Joint
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_joint2d_mut(&mut self) -> &mut Joint
pub fn as_joint2d_mut(&mut self) -> &mut Joint
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_sound(&self) -> &Sound
pub fn as_sound(&self) -> &Sound
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_sound_mut(&mut self) -> &mut Sound
pub fn as_sound_mut(&mut self) -> &mut Sound
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn is_listener(&self) -> bool
pub fn is_listener(&self) -> bool
Returns true if node is instance of given type.
Sourcepub fn as_listener(&self) -> &Listener
pub fn as_listener(&self) -> &Listener
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_listener_mut(&mut self) -> &mut Listener
pub fn as_listener_mut(&mut self) -> &mut Listener
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Returns true if node is instance of given type.
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_absm(&self) -> &AnimationBlendingStateMachine
pub fn as_absm(&self) -> &AnimationBlendingStateMachine
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_absm_mut(&mut self) -> &mut AnimationBlendingStateMachine
pub fn as_absm_mut(&mut self) -> &mut AnimationBlendingStateMachine
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn is_animation_player(&self) -> bool
pub fn is_animation_player(&self) -> bool
Returns true if node is instance of given type.
Sourcepub fn as_animation_player(&self) -> &AnimationPlayer
pub fn as_animation_player(&self) -> &AnimationPlayer
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_animation_player_mut(&mut self) -> &mut AnimationPlayer
pub fn as_animation_player_mut(&mut self) -> &mut AnimationPlayer
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Sourcepub fn is_ragdoll(&self) -> bool
pub fn is_ragdoll(&self) -> bool
Returns true if node is instance of given type.
Sourcepub fn as_ragdoll(&self) -> &Ragdoll
pub fn as_ragdoll(&self) -> &Ragdoll
Tries to cast shared reference to a node to given type, panics if cast is not possible.
Sourcepub fn as_ragdoll_mut(&mut self) -> &mut Ragdoll
pub fn as_ragdoll_mut(&mut self) -> &mut Ragdoll
Tries to cast mutable reference to a node to given type, panics if cast is not possible.
Trait Implementations§
Source§impl ComponentProvider for Node
impl ComponentProvider for Node
Source§impl ConstructorProvider<Node, Graph> for AnimationBlendingStateMachine
impl ConstructorProvider<Node, Graph> for AnimationBlendingStateMachine
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for AnimationPlayer
impl ConstructorProvider<Node, Graph> for AnimationPlayer
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Camera
impl ConstructorProvider<Node, Graph> for Camera
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Collider
impl ConstructorProvider<Node, Graph> for Collider
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Collider
impl ConstructorProvider<Node, Graph> for Collider
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Decal
impl ConstructorProvider<Node, Graph> for Decal
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for DirectionalLight
impl ConstructorProvider<Node, Graph> for DirectionalLight
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Joint
impl ConstructorProvider<Node, Graph> for Joint
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Joint
impl ConstructorProvider<Node, Graph> for Joint
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Listener
impl ConstructorProvider<Node, Graph> for Listener
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Mesh
impl ConstructorProvider<Node, Graph> for Mesh
fn constructor() -> NodeConstructor
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for ParticleSystem
impl ConstructorProvider<Node, Graph> for ParticleSystem
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Pivot
impl ConstructorProvider<Node, Graph> for Pivot
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for PointLight
impl ConstructorProvider<Node, Graph> for PointLight
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Ragdoll
impl ConstructorProvider<Node, Graph> for Ragdoll
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Rectangle
impl ConstructorProvider<Node, Graph> for Rectangle
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for RigidBody
impl ConstructorProvider<Node, Graph> for RigidBody
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for RigidBody
impl ConstructorProvider<Node, Graph> for RigidBody
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Sound
impl ConstructorProvider<Node, Graph> for Sound
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for SpotLight
impl ConstructorProvider<Node, Graph> for SpotLight
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Sprite
impl ConstructorProvider<Node, Graph> for Sprite
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for Terrain
impl ConstructorProvider<Node, Graph> for Terrain
fn constructor() -> NodeConstructor
Source§impl ConstructorProvider<Node, Graph> for TileMap
impl ConstructorProvider<Node, Graph> for TileMap
fn constructor() -> NodeConstructor
Source§impl NameProvider for Node
impl NameProvider for Node
Source§impl Reflect for Node
impl Reflect for Node
fn source_path() -> &'static str
fn type_name(&self) -> &'static str
fn doc(&self) -> &'static str
Source§fn assembly_name(&self) -> &'static str
fn assembly_name(&self) -> &'static str
#[derive(Reflect)]
) to ensure that this method will return correct assembly
name. In other words - there’s no guarantee, that any implementation other than proc-macro
will return a correct name of the assembly. Alternatively, you can use env!("CARGO_PKG_NAME")
as an implementation.Source§fn type_assembly_name() -> &'static str
fn type_assembly_name() -> &'static str
#[derive(Reflect)]
) to ensure that this method will return correct assembly
name. In other words - there’s no guarantee, that any implementation other than proc-macro
will return a correct name of the assembly. Alternatively, you can use env!("CARGO_PKG_NAME")
as an implementation.fn fields_info(&self, func: &mut dyn FnMut(&[FieldInfo<'_, '_>]))
fn into_any(self: Box<Self>) -> Box<dyn Any>
fn as_any(&self, func: &mut dyn FnMut(&dyn Any))
fn as_any_mut(&mut self, func: &mut dyn FnMut(&mut dyn Any))
fn as_reflect(&self, func: &mut dyn FnMut(&dyn Reflect))
fn as_reflect_mut(&mut self, func: &mut dyn FnMut(&mut dyn Reflect))
fn set( &mut self, value: Box<dyn Reflect>, ) -> Result<Box<dyn Reflect>, Box<dyn Reflect>>
Source§fn set_field(
&mut self,
field: &str,
value: Box<dyn Reflect>,
func: &mut dyn FnMut(Result<Box<dyn Reflect>, Box<dyn Reflect>>),
)
fn set_field( &mut self, field: &str, value: Box<dyn Reflect>, func: &mut dyn FnMut(Result<Box<dyn Reflect>, Box<dyn Reflect>>), )
#[reflect(setter = ..)]
or falls back to
Reflect::field_mut
fn fields(&self, func: &mut dyn FnMut(&[&dyn Reflect]))
fn fields_mut(&mut self, func: &mut dyn FnMut(&mut [&mut dyn Reflect]))
fn field(&self, name: &str, func: &mut dyn FnMut(Option<&dyn Reflect>))
fn field_mut( &mut self, name: &str, func: &mut dyn FnMut(Option<&mut dyn Reflect>), )
fn as_array(&self, func: &mut dyn FnMut(Option<&(dyn ReflectArray + 'static)>))
fn as_array_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectArray + 'static)>), )
fn as_list(&self, func: &mut dyn FnMut(Option<&(dyn ReflectList + 'static)>))
fn as_list_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectList + 'static)>), )
fn as_inheritable_variable( &self, func: &mut dyn FnMut(Option<&(dyn ReflectInheritableVariable + 'static)>), )
fn as_inheritable_variable_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectInheritableVariable + 'static)>), )
fn as_hash_map( &self, func: &mut dyn FnMut(Option<&(dyn ReflectHashMap + 'static)>), )
fn as_hash_map_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectHashMap + 'static)>), )
Source§impl SceneGraphNode for Node
impl SceneGraphNode for Node
type Base = Base
type SceneGraph = Graph
type ResourceData = Model
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>]
Source§fn 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>
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>>
Source§fn component_ref<T>(&self) -> Option<&T>where
T: Any,
fn component_ref<T>(&self) -> Option<&T>where
T: Any,
Source§fn component_mut<T>(&mut self) -> Option<&mut T>where
T: Any,
fn component_mut<T>(&mut self) -> Option<&mut T>where
T: Any,
Source§fn has_component<T>(&self) -> boolwhere
T: Any,
fn has_component<T>(&self) -> boolwhere
T: Any,
Auto Trait Implementations§
impl Freeze for Node
impl !RefUnwindSafe for Node
impl Send for Node
impl !Sync for Node
impl Unpin for Node
impl !UnwindSafe for Node
Blanket Implementations§
Source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.fn into_any(self: Box<T>) -> Box<dyn Any>
Source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReflectBase for Twhere
T: Reflect,
impl<T> ReflectBase for Twhere
T: Reflect,
fn as_any_raw(&self) -> &(dyn Any + 'static)
fn as_any_raw_mut(&mut self) -> &mut (dyn Any + 'static)
Source§impl<T> ResolvePath for Twhere
T: Reflect,
impl<T> ResolvePath for Twhere
T: Reflect,
fn resolve_path<'p>( &self, path: &'p str, func: &mut dyn FnMut(Result<&(dyn Reflect + 'static), ReflectPathError<'p>>), )
fn resolve_path_mut<'p>( &mut self, path: &'p str, func: &mut dyn FnMut(Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>), )
fn get_resolve_path<'p, T>(
&self,
path: &'p str,
func: &mut dyn FnMut(Result<&T, ReflectPathError<'p>>),
)where
T: Reflect,
fn get_resolve_path_mut<'p, T>(
&mut self,
path: &'p str,
func: &mut dyn FnMut(Result<&mut T, ReflectPathError<'p>>),
)where
T: Reflect,
Source§impl<T> ScriptMessagePayload for T
impl<T> ScriptMessagePayload for T
Source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
self
as &dyn Any
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
self
as &dyn Any
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.