Expand description
Functionality that relates to the Template trait.
Structs§
- FnTemplate
- A
Templatedriven by a function that returns an output. This is used to create “free floating” templates without defining a new type. Seetemplatefor usage. - Inner
Scene Entity Reference - The inner struct actually storing the unique index
- Scene
Entity Reference - A unique reference for a named entity in a scene.
Usually used by
bevy_scenein generated code - Scene
Entity References - Struct to store a mapping from
SceneEntityReferencetoEntitywhich are used for resolving#Nameentity references in bsn! macros - Template
Context - The context used to apply the current
Template. This contains a reference to the entity that the template is being applied to (via anEntityWorldMut). - Template
Tuple - A wrapper over a tuple of
Templateimplementations, which also implementsTemplate. This exists becauseTemplatecannot be directly implemented for tuples ofTemplateimplementations. - VecTemplate
- A
TemplateforVec.
Enums§
- Entity
Template - A
Templatereference to anEntity. - Option
Template - A
TemplateforOption.
Traits§
- Built
InTemplate - Roughly equivalent to
FromTemplate, but does not have a blanket implementation forDefault+Clonetypes. This is generally used for common generic collection types likeOptionandVec, which haveDefault+Cloneimpls and therefore also pick up theFromTemplatebehavior. This is fine when theTinOption<T>is not “templated” (ex: does not have an explicitFromTemplatederive). But ifTis “templated”, such asOption<Handle<T>>, then it would require a manual#[template(OptionTemplate<HandleTemplate<T>>)]field annotation. This isn’t fun to type out. - From
Template FromTemplateis implemented for types that can be produced by a specific, canonicalTemplate. This creates a way to correlate to theTemplateusing the desired template output type. This is used by Bevy’s scene system.- Specialize
From Template - This is used to help improve error messages related to
FromTemplatespecialization. Developers should generally just ignore this trait and read the error message when they encounter it. - Template
- A
Templateis something that, given a spawn context (targetEntity,World, etc), can produce aTemplate::Output.
Functions§
- template
- Returns a “free floating” template for a given
func. This prevents the need to define a custom type for one-off templates.
Derive Macros§
- From
Template - Derives
FromTemplate.