pub struct ReflectEventFns { /* private fields */ }Expand description
The raw function pointers needed to make up a ReflectEvent.
This is used when creating custom implementations of ReflectEvent with
ReflectEventFns::new().
Note: Creating custom implementations of
ReflectEventis an advanced feature that most users will not need. Usually aReflectEventis created for a type by derivingReflectand adding the#[reflect(Event)]attribute. After adding the component to theTypeRegistry, itsReflectEventcan then be retrieved when needed.
Creating a custom ReflectEvent may be useful if you need to create new component types
at runtime, for example, for scripting implementations.
By creating a custom ReflectEvent and inserting it into a type’s
TypeRegistration,
you can modify the way that reflected event of that type will be triggered in the Bevy
world.
Implementations§
Source§impl ReflectEventFns
impl ReflectEventFns
Sourcepub fn new<'a, T: Event + FromReflect + TypePath>() -> Self
pub fn new<'a, T: Event + FromReflect + TypePath>() -> Self
Get the default set of ReflectEventFns for a specific event type using its
FromType implementation.
This is useful if you want to start with the default implementation before overriding some of the functions to create a custom implementation.
Trait Implementations§
Source§impl Clone for ReflectEventFns
impl Clone for ReflectEventFns
Source§fn clone(&self) -> ReflectEventFns
fn clone(&self) -> ReflectEventFns
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ReflectEventFns
impl RefUnwindSafe for ReflectEventFns
impl Send for ReflectEventFns
impl Sync for ReflectEventFns
impl Unpin for ReflectEventFns
impl UnwindSafe for ReflectEventFns
Blanket Implementations§
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>, 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.