Struct Node

Source
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

Source

pub fn new<T: NodeTrait>(node: T) -> Self

Creates a new node instance from any type that implements NodeTrait.

Source

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")
}
Source

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")
}
Source

pub fn is_mesh(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_mesh(&self) -> &Mesh

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_pivot(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_pivot(&self) -> &Pivot

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_camera(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_camera(&self) -> &Camera

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_spot_light(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_spot_light(&self) -> &SpotLight

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_point_light(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_point_light(&self) -> &PointLight

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_directional_light(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_directional_light(&self) -> &DirectionalLight

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_particle_system(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_particle_system(&self) -> &ParticleSystem

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_sprite(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_sprite(&self) -> &Sprite

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_terrain(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_terrain(&self) -> &Terrain

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_decal(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_decal(&self) -> &Decal

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_rectangle(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_rectangle(&self) -> &Rectangle

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_rigid_body(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_rigid_body(&self) -> &RigidBody

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_collider(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_collider(&self) -> &Collider

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_joint(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_joint(&self) -> &Joint

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_rigid_body2d(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_rigid_body2d(&self) -> &RigidBody

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_collider2d(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_collider2d(&self) -> &Collider

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_joint2d(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_joint2d(&self) -> &Joint

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_sound(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_sound(&self) -> &Sound

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_listener(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_listener(&self) -> &Listener

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_navigational_mesh(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_navigational_mesh(&self) -> &NavigationalMesh

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

pub fn as_navigational_mesh_mut(&mut self) -> &mut NavigationalMesh

Tries to cast mutable reference to a node to given type, panics if cast is not possible.

Source

pub fn is_absm(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_absm(&self) -> &AnimationBlendingStateMachine

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_animation_player(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_animation_player(&self) -> &AnimationPlayer

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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.

Source

pub fn is_ragdoll(&self) -> bool

Returns true if node is instance of given type.

Source

pub fn as_ragdoll(&self) -> &Ragdoll

Tries to cast shared reference to a node to given type, panics if cast is not possible.

Source

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 Clone for Node

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ComponentProvider for Node

Source§

fn query_component_ref(&self, type_id: TypeId) -> Option<&dyn Any>

Allows an object to provide access to inner components.
Source§

fn query_component_mut(&mut self, type_id: TypeId) -> Option<&mut dyn Any>

Allows an object to provide access to inner components.
Source§

impl ConstructorProvider<Node, Graph> for AnimationBlendingStateMachine

Source§

impl ConstructorProvider<Node, Graph> for AnimationPlayer

Source§

impl ConstructorProvider<Node, Graph> for Camera

Source§

impl ConstructorProvider<Node, Graph> for Collider

Source§

impl ConstructorProvider<Node, Graph> for Collider

Source§

impl ConstructorProvider<Node, Graph> for Decal

Source§

impl ConstructorProvider<Node, Graph> for DirectionalLight

Source§

impl ConstructorProvider<Node, Graph> for Joint

Source§

impl ConstructorProvider<Node, Graph> for Joint

Source§

impl ConstructorProvider<Node, Graph> for Listener

Source§

impl ConstructorProvider<Node, Graph> for Mesh

Source§

impl ConstructorProvider<Node, Graph> for NavigationalMesh

Source§

impl ConstructorProvider<Node, Graph> for ParticleSystem

Source§

impl ConstructorProvider<Node, Graph> for Pivot

Source§

impl ConstructorProvider<Node, Graph> for PointLight

Source§

impl ConstructorProvider<Node, Graph> for Ragdoll

Source§

impl ConstructorProvider<Node, Graph> for Rectangle

Source§

impl ConstructorProvider<Node, Graph> for RigidBody

Source§

impl ConstructorProvider<Node, Graph> for RigidBody

Source§

impl ConstructorProvider<Node, Graph> for Sound

Source§

impl ConstructorProvider<Node, Graph> for SpotLight

Source§

impl ConstructorProvider<Node, Graph> for Sprite

Source§

impl ConstructorProvider<Node, Graph> for Terrain

Source§

impl ConstructorProvider<Node, Graph> for TileMap

Source§

impl Debug for Node

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DerefMut for Node

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<T: NodeTrait> From<T> for Node

Source§

fn from(value: T) -> Self

Converts to this type from the input type.
Source§

impl NameProvider for Node

Source§

fn name(&self) -> &str

Returns a reference to the name of the entity.
Source§

impl Reflect for Node

Source§

fn source_path() -> &'static str

Source§

fn type_name(&self) -> &'static str

Source§

fn doc(&self) -> &'static str

Source§

fn assembly_name(&self) -> &'static str

Returns a parent assembly name of the type that implements this trait. WARNING: You should use proc-macro (#[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

Returns a parent assembly name of the type that implements this trait. WARNING: You should use proc-macro (#[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 fields_info(&self, func: &mut dyn FnMut(&[FieldInfo<'_, '_>]))

Source§

fn into_any(self: Box<Self>) -> Box<dyn Any>

Source§

fn as_any(&self, func: &mut dyn FnMut(&dyn Any))

Source§

fn as_any_mut(&mut self, func: &mut dyn FnMut(&mut dyn Any))

Source§

fn as_reflect(&self, func: &mut dyn FnMut(&dyn Reflect))

Source§

fn as_reflect_mut(&mut self, func: &mut dyn FnMut(&mut dyn Reflect))

Source§

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>>), )

Calls user method specified with #[reflect(setter = ..)] or falls back to Reflect::field_mut
Source§

fn fields(&self, func: &mut dyn FnMut(&[&dyn Reflect]))

Source§

fn fields_mut(&mut self, func: &mut dyn FnMut(&mut [&mut dyn Reflect]))

Source§

fn field(&self, name: &str, func: &mut dyn FnMut(Option<&dyn Reflect>))

Source§

fn field_mut( &mut self, name: &str, func: &mut dyn FnMut(Option<&mut dyn Reflect>), )

Source§

fn as_array(&self, func: &mut dyn FnMut(Option<&(dyn ReflectArray + 'static)>))

Source§

fn as_array_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectArray + 'static)>), )

Source§

fn as_list(&self, func: &mut dyn FnMut(Option<&(dyn ReflectList + 'static)>))

Source§

fn as_list_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectList + 'static)>), )

Source§

fn as_inheritable_variable( &self, func: &mut dyn FnMut(Option<&(dyn ReflectInheritableVariable + 'static)>), )

Source§

fn as_inheritable_variable_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectInheritableVariable + 'static)>), )

Source§

fn as_hash_map( &self, func: &mut dyn FnMut(Option<&(dyn ReflectHashMap + 'static)>), )

Source§

fn as_hash_map_mut( &mut self, func: &mut dyn FnMut(Option<&mut (dyn ReflectHashMap + 'static)>), )

Source§

impl SceneGraphNode for Node

Source§

type Base = Base

Source§

type SceneGraph = Graph

Source§

type ResourceData = Model

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 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.
Source§

impl TypeUuidProvider for Node

Source§

fn type_uuid() -> Uuid

Return type UUID.
Source§

impl Visit for Node

Source§

fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult

Read or write this value, depending on whether Visitor::is_reading() is true or false. Read more
Source§

impl Deref for Node

Source§

type Target = dyn NodeTrait<Target = Base>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsyncTaskResult for T
where T: Any + Send + 'static,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

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

Convert 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)

Convert &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)

Convert &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 T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts self reference as a reference to Any. Could be used to downcast a trait object to a particular type.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts self reference as a reference to Any. Could be used to downcast a trait object to a particular type.
Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

impl<T> FieldValue for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Casts self to a &dyn Any
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<R> GetField for R
where R: Reflect,

Source§

fn get_field<T>(&self, name: &str, func: &mut dyn FnMut(Option<&T>))
where T: 'static,

Source§

fn get_field_mut<T>(&mut self, name: &str, func: &mut dyn FnMut(Option<&mut T>))
where T: 'static,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ReflectBase for T
where T: Reflect,

Source§

fn as_any_raw(&self) -> &(dyn Any + 'static)

Source§

fn as_any_raw_mut(&mut self) -> &mut (dyn Any + 'static)

Source§

impl<T> ResolvePath for T
where T: Reflect,

Source§

fn resolve_path<'p>( &self, path: &'p str, func: &mut dyn FnMut(Result<&(dyn Reflect + 'static), ReflectPathError<'p>>), )

Source§

fn resolve_path_mut<'p>( &mut self, path: &'p str, func: &mut dyn FnMut(Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>), )

Source§

fn get_resolve_path<'p, T>( &self, path: &'p str, func: &mut dyn FnMut(Result<&T, ReflectPathError<'p>>), )
where T: Reflect,

Source§

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ScriptMessagePayload for T
where T: 'static + Send + Debug,

Source§

fn as_any_ref(&self) -> &(dyn Any + 'static)

Returns self as &dyn Any
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Returns self as &dyn Any
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Value for T
where T: Reflect + Clone + Debug + Send,

Source§

fn clone_box(&self) -> Box<dyn Value>

Source§

fn into_box_reflect(self: Box<T>) -> Box<dyn Reflect>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> AbstractSceneNode for T
where T: SceneGraphNode,

Source§

impl<T> InspectableEnum for T
where T: Debug + Reflect + Clone + TypeUuidProvider + Send + 'static,