pub enum TypeInfo {
Struct(StructInfo),
TupleStruct(TupleStructInfo),
Tuple(TupleInfo),
List(ListInfo),
Array(ArrayInfo),
Map(MapInfo),
Set(SetInfo),
Enum(EnumInfo),
Opaque(OpaqueInfo),
}Expand description
Compile-time type information for various reflected types.
Generally, for any given type, this value can be retrieved in one of four ways:
Typed::type_infoDynamicTyped::reflect_type_infoPartialReflect::get_represented_type_infoTypeRegistry::get_type_info
Each returns a static reference to TypeInfo, but they all have their own use cases.
For example, if you know the type at compile time, Typed::type_info is probably
the simplest. If you have a dyn Reflect you can use DynamicTyped::reflect_type_info.
If all you have is a dyn PartialReflect, you’ll probably want PartialReflect::get_represented_type_info.
Lastly, if all you have is a TypeId or type path, you will need to go through
TypeRegistry::get_type_info.
You may also opt to use TypeRegistry::get_type_info in place of the other methods simply because
it can be more performant. This is because those other methods may require attaining a lock on
the static TypeInfo, while the registry simply checks a map.
Variants§
Struct(StructInfo)
Type information for a struct-like type.
TupleStruct(TupleStructInfo)
Type information for a tuple-struct-like type.
Tuple(TupleInfo)
Type information for a tuple-like type.
List(ListInfo)
Type information for a list-like type.
Array(ArrayInfo)
Type information for an array-like type.
Map(MapInfo)
Type information for a map-like type.
Set(SetInfo)
Type information for a set-like type.
Enum(EnumInfo)
Type information for an enum-like type.
Opaque(OpaqueInfo)
Type information for an opaque type - see the OpaqueInfo docs for
a discussion of opaque types.
Implementations§
Source§impl TypeInfo
impl TypeInfo
Sourcepub fn type_id(&self) -> TypeId
pub fn type_id(&self) -> TypeId
The TypeId of the underlying type.
Examples found in repository?
95fn modify_selected_component(world: &mut World) {
96 // We're using keyboard input to trigger modifications for simplicity.
97 let button_input = world.resource::<ButtonInput<KeyCode>>();
98 let direction_of_modification = if button_input.pressed(KeyCode::ArrowUp) {
99 1.0
100 } else if button_input.pressed(KeyCode::ArrowDown) {
101 -1.0
102 } else {
103 return; // No modification requested
104 };
105
106 let selected = world.resource::<SelectedComponent>().clone();
107
108 let mut sprite_query = world.query_filtered::<Entity, With<Sprite>>();
109
110 // This entity should generally be gathered via UI selection in a real application
111 let entity = sprite_query.iter(world).next().unwrap();
112
113 // We could cheat and use `TypeId::of::<T>()` to get the type ID of a known type,
114 // but real applications identify types by name (from a UI dropdown, text entry or a script).
115 let type_name = match selected {
116 // Note that Bevy's native types are registered under their full subcrate paths:
117 // `bevy_transform`, not `bevy::transform`, `bevy::prelude`, or `bevy_transform::prelude`.
118 // You can use `<T as TypePath>::type_path()` to look this up.
119 SelectedComponent::Transform => "bevy_transform::components::transform::Transform",
120 SelectedComponent::Sprite => "bevy_sprite::sprite::Sprite",
121 };
122
123 // Then, we need to use a type registry to resolve the type name to a `TypeId`.
124 // Types are (for the most part) registered automatically by Bevy,
125 // but you can also register your own types using `App::register_type`.
126 // Generic types always need to be registered manually;
127 // if a type is not showing up in your tool, check if that's the problem.
128 // You can check which types are registered by calling `TypeRegistry::iter()`,
129 // and then use the `Debug` impl for `TypeRegistration` objects to see their names and paths.
130 let app_registry = world.resource::<AppTypeRegistry>().clone();
131 let type_id = app_registry
132 .read()
133 .get_with_type_path(type_name)
134 .expect("Type was not registered, or its full path was ambiguous")
135 .type_id();
136
137 let mut reflected_component: Mut<dyn Reflect> = world.get_reflect_mut(entity, type_id).unwrap();
138
139 match selected {
140 // Downcasting is the easy path:
141 // if you happen to know the type, you can downcast and modify directly.
142 // The problem is that each of these paths would need to be hard-coded (or rely on extensive code-gen),
143 // largely defeating the purpose of using reflection in the first place.
144 SelectedComponent::Sprite => {
145 // Make sure that the type matches the component type you requested to modify.
146 // In a real project, you would want to handle this gracefully.
147 // Downcasting converts the value *directly* into a specified concrete type,
148 // allowing you to escape back into faster, strongly-typed code.
149 let downcast_sprite: &mut Sprite =
150 reflected_component.downcast_mut::<Sprite>().unwrap();
151 // Be careful not to modify a copy of the color — use `&mut`!
152 let color = &mut downcast_sprite.color;
153
154 let new_alpha = (color.alpha() + 0.01 * direction_of_modification).clamp(0.0, 1.0);
155 color.set_alpha(new_alpha);
156 }
157 // This arm demonstrates the more realistic, generic pattern:
158 // walking the reflected type info to find fields to modify.
159 // The benefit is that we can use these patterns
160 // to operate over *any* data based on our knowledge of its shape (recorded using reflection),
161 // without needing to know the concrete type at compile time.
162 SelectedComponent::Transform => {
163 let reflect_mut: ReflectMut<'_> = reflected_component.reflect_mut();
164 // In the fully generic case, we would need to match on the `ReflectMut` variants
165 // and handle each of the arms exhaustively.
166 // `struct_mut` is of type `&mut dyn Struct`, one of a number
167 // of traits that encodes the logic of Rust's type system into a runtime representation.
168 let ReflectMut::Struct(struct_mut) = reflect_mut else {
169 error!("Expected the Transform component type to be a struct");
170 return;
171 };
172
173 // Get the `translation` field as a `&mut dyn PartialReflect`,
174 // which is a type-erased representation of a value that can be modified.
175 let translation_field = struct_mut.field_mut("translation").unwrap();
176
177 // Now, we can repeat the process to get the `y` field of the `translation` Vec3
178 // In a real application, this would probably be done via a recursive function!
179 let ReflectMut::Struct(translation_struct) = translation_field.reflect_mut() else {
180 error!("Expected the translation field to be a struct");
181 return;
182 };
183
184 // We could downcast to an f32 again here, but that would be cheating!
185 // How do you generalize this sort of operation, if, for example,
186 // you wanted to build a generic inspector that could modify any numeric field of any component type?
187 // The solution lies in the way that Bevy can reflect *traits* as well as types,
188 // allowing type owners to define and register additional behavior for their types.
189 // This data is registered automatically at compile time using an inventory-like solution,
190 // and operates on a per-type x per-trait basis,
191 // just like ordinary type reflection.
192 //
193 // We want to increase or decrease the value here,
194 // so we need the `AddAssign` trait
195 // which are already implemented for f32.
196 //
197 // But `AddAssign` is not a supertrait of `PartialReflect`!
198 // We don't have access to its methods! How could that possibly work?
199 //
200 // The solution is again to register the compile time information that we want to use at runtime;
201 // storing function pointers to the trait methods in the type registry.
202 // In order to make this work, we need shadow "reflect" versions of the traits we want to use at runtime.
203 // Bevy provides a few of these out of the box, including `ReflectAddAssign` and `ReflectSubAssign`.
204 // That's what the `#[reflect(Add)]` attributes that you see scattered about in Bevy's source code are doing:
205 // generating implementations of the reflect versions of the traits, so they can later be registered and used at runtime.
206 //
207 // For more information, see the `type_data` example.
208 let y_field: &mut dyn PartialReflect = translation_struct.field_mut("y").unwrap();
209 let field_type_id = y_field
210 .get_represented_type_info()
211 .expect("Found a dynamic type unexpectedly")
212 .type_id();
213
214 let add_assign_trait_data = app_registry
215 .read()
216 .get_type_data::<ReflectAddAssign>(field_type_id)
217 .expect("f32 failed to register ReflectAddAssign")
218 .clone();
219
220 // We need to operate on the value as a concrete type,
221 // so we need to convert it into the more powerful &dyn Reflect type.
222 let y_field: &mut dyn Reflect = y_field.try_as_reflect_mut().expect(
223 "Found a dynamic type unexpectedly, but we need a concrete type to modify it",
224 );
225
226 // We're still cheating a bit here!
227 // By doing this we just *assume* that there's an f32 value when trying to determine what to add to the field.
228 // We *could* try all of the common numeric types, but that would be slow and non-extensible.
229 //
230 // In a real workflow, you would want a dedicated trait with additional methods that exposes
231 // something like dedicated `increment` and `decrement` methods, which handle the type-specific logic of how to modify the value.
232 // Remember to register that trait, and create your own analog of `ReflectAddAssign` for it!
233 //
234 // We don't do that here to avoid making this example *even more* complicated.
235 const MAGNITUDE_OF_MODIFICATION: f32 = 10.;
236 let delta = direction_of_modification * MAGNITUDE_OF_MODIFICATION;
237 let boxed_delta: Box<dyn PartialReflect> = Box::new(delta);
238 add_assign_trait_data
239 .add_assign(y_field, boxed_delta)
240 .expect("We cheated and know the types match, so this should always succeed.");
241 }
242 }
243}Sourcepub fn type_path_table(&self) -> &TypePathTable
pub fn type_path_table(&self) -> &TypePathTable
A representation of the type path of the underlying type.
Provides dynamic access to all methods on TypePath.
Sourcepub fn type_path(&self) -> &'static str
pub fn type_path(&self) -> &'static str
The stable, full type path of the underlying type.
Use type_path_table if you need access to the other methods on TypePath.
Examples found in repository?
22fn setup(type_registry: Res<AppTypeRegistry>) {
23 let type_registry = type_registry.read();
24
25 let registration = type_registry.get(TypeId::of::<MyType<u32>>()).unwrap();
26 info!(
27 "Registration for {} exists",
28 registration.type_info().type_path(),
29 );
30
31 // MyType<String> was not manually registered, so it does not exist
32 assert!(type_registry.get(TypeId::of::<MyType<String>>()).is_none());
33}Sourcepub fn docs(&self) -> Option<&str>
Available on crate feature reflect_documentation only.
pub fn docs(&self) -> Option<&str>
reflect_documentation only.The docstring of the underlying type, if any.
Sourcepub fn kind(&self) -> ReflectKind
pub fn kind(&self) -> ReflectKind
Returns the kind of this TypeInfo.
Source§impl TypeInfo
Conversion convenience methods for TypeInfo.
impl TypeInfo
Conversion convenience methods for TypeInfo.
Sourcepub fn as_struct(&self) -> Result<&StructInfo, TypeInfoError>
pub fn as_struct(&self) -> Result<&StructInfo, TypeInfoError>
Attempts a cast to StructInfo.
Returns an error if self is not TypeInfo::Struct.
Sourcepub fn as_tuple_struct(&self) -> Result<&TupleStructInfo, TypeInfoError>
pub fn as_tuple_struct(&self) -> Result<&TupleStructInfo, TypeInfoError>
Attempts a cast to TupleStructInfo.
Returns an error if self is not TypeInfo::TupleStruct.
Sourcepub fn as_tuple(&self) -> Result<&TupleInfo, TypeInfoError>
pub fn as_tuple(&self) -> Result<&TupleInfo, TypeInfoError>
Attempts a cast to TupleInfo.
Returns an error if self is not TypeInfo::Tuple.
Sourcepub fn as_list(&self) -> Result<&ListInfo, TypeInfoError>
pub fn as_list(&self) -> Result<&ListInfo, TypeInfoError>
Attempts a cast to ListInfo.
Returns an error if self is not TypeInfo::List.
Sourcepub fn as_array(&self) -> Result<&ArrayInfo, TypeInfoError>
pub fn as_array(&self) -> Result<&ArrayInfo, TypeInfoError>
Attempts a cast to ArrayInfo.
Returns an error if self is not TypeInfo::Array.
Sourcepub fn as_map(&self) -> Result<&MapInfo, TypeInfoError>
pub fn as_map(&self) -> Result<&MapInfo, TypeInfoError>
Attempts a cast to MapInfo.
Returns an error if self is not TypeInfo::Map.
Sourcepub fn as_set(&self) -> Result<&SetInfo, TypeInfoError>
pub fn as_set(&self) -> Result<&SetInfo, TypeInfoError>
Attempts a cast to SetInfo.
Returns an error if self is not TypeInfo::Set.
Sourcepub fn as_enum(&self) -> Result<&EnumInfo, TypeInfoError>
pub fn as_enum(&self) -> Result<&EnumInfo, TypeInfoError>
Attempts a cast to EnumInfo.
Returns an error if self is not TypeInfo::Enum.
Sourcepub fn as_opaque(&self) -> Result<&OpaqueInfo, TypeInfoError>
pub fn as_opaque(&self) -> Result<&OpaqueInfo, TypeInfoError>
Attempts a cast to OpaqueInfo.
Returns an error if self is not TypeInfo::Opaque.
Trait Implementations§
Source§impl TypedProperty for TypeInfo
impl TypedProperty for TypeInfo
Source§type Stored = TypeInfo
type Stored = TypeInfo
GenericTypeCell.Auto Trait Implementations§
impl !RefUnwindSafe for TypeInfo
impl !UnwindSafe for TypeInfo
impl Freeze for TypeInfo
impl Send for TypeInfo
impl Sync for TypeInfo
impl Unpin for TypeInfo
impl UnsafeUnpin for TypeInfo
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
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>, which can then be
downcast into Box<dyn 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>, which 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 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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T> HitDataExtra for T
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
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> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Source§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> PatchTemplate for Twhere
T: Template,
impl<T> PatchTemplate for Twhere
T: Template,
Source§fn patch_template<F>(func: F) -> TemplatePatch<F, T>
fn patch_template<F>(func: F) -> TemplatePatch<F, T>
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Settings for T
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.Source§impl<T> Template for T
impl<T> Template for T
Source§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.Source§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.Source§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
self.