pub struct ChargeState<A: Abilitylike> { /* private fields */ }Expand description
A component that stores the Charges for each Abilitylike action of type A.
If Charges is set for an actions, it is only Abilitylike::ready when at least one charge is available.
use bevy::reflect::Reflect;
use leafwing_abilities::prelude::*;
use leafwing_abilities::premade_pools::mana::{Mana, ManaPool};
use leafwing_input_manager::Actionlike;
#[derive(Actionlike, Abilitylike, Debug, Clone, Reflect, Hash, PartialEq, Eq)]
enum Action {
// Neither cooldowns nor charges
Move,
// Double jump: 2 charges, no cooldowns
Jump,
// Simple cooldown
Dash,
// Cooldowns and charges, replenishing one at a time
Spell,
}
impl Action {
fn charges() -> ChargeState<Action> {
// You can either use the builder pattern or the `new` init for both cooldowns and charges
// The differences are largely aesthetic.
ChargeState::default()
// Double jump!
.set(Action::Jump, Charges::replenish_all(2))
// Store up to 3 spells at once
.set(Action::Spell, Charges::replenish_one(3))
.build()
}
fn cooldowns() -> CooldownState<Action> {
// Omitted cooldowns and charges will cause the action to be treated as if it always had available cooldowns / charges to use.
CooldownState::new([
(Action::Dash, Cooldown::from_secs(2.)),
(Action::Spell, Cooldown::from_secs(4.5)),
])
}
fn mana_costs() -> AbilityCosts<Action, ManaPool> {
// Provide the Pool::Quantity value when setting costs
AbilityCosts::new([
(Action::Spell, Mana(10.)),
])
}
}
// In a real game you'd spawn a bundle with the appropriate components.
let mut abilities_bundle = AbilitiesBundle {
cooldowns: Action::cooldowns(),
charges: Action::charges(),
..Default::default()
};
// You can also define resource pools using a separate bundle.
// Typically, you'll want to nest both of these bundles under a custom Bundle type for your characters.
let mut mana_bundle = PoolBundle {
// Max mana of 100., regen rate of 1.
pool: ManaPool::new(Mana(100.0), Mana(100.0), Mana(1.0)),
ability_costs: Action::mana_costs(),
};
// Then, you can check if an action is ready to be used.
// Consider using the `AbilityState` `WorldQuery` type instead for convenience!
if Action::Spell.ready(&abilities_bundle.charges, &abilities_bundle.cooldowns, Some(&mana_bundle.pool), Some(&mana_bundle.ability_costs)).is_ok() {
// When you use an action, remember to trigger it!
Action::Spell.trigger(&mut abilities_bundle.charges, &mut abilities_bundle.cooldowns, Some(&mut mana_bundle.pool), Some(&mut mana_bundle.ability_costs));
}Implementations§
Source§impl<A: Abilitylike> ChargeState<A>
impl<A: Abilitylike> ChargeState<A>
Sourcepub fn new(
action_chargestate_pairs: impl IntoIterator<Item = (A, Charges)>,
) -> Self
pub fn new( action_chargestate_pairs: impl IntoIterator<Item = (A, Charges)>, ) -> Self
Creates a new ChargeState from an iterator of (charges, action) pairs
If a Charges is not provided for an action, that action will be treated as if a charge was always available.
To create an empty ChargeState struct, use the Default::default method instead.
§Example
use bevy::{input::keyboard::KeyCode, reflect::Reflect};
use leafwing_abilities::prelude::*;
use leafwing_input_manager::Actionlike;
#[derive(Actionlike, Abilitylike, Debug, Clone, Copy, PartialEq, Eq, Hash, Reflect)]
enum Action {
Run,
Jump,
Shoot,
Dash,
}
let charge_state = ChargeState::new([
(Action::Shoot, Charges::replenish_all(6)),
(Action::Dash, Charges::replenish_one(2)),
]);Sourcepub fn replenish(&mut self, action: &A)
pub fn replenish(&mut self, action: &A)
Replenishes charges of action, up to its max charges.
The exact effect is determined by the Charges’s ReplenishStrategy.
If the action is not associated with a Charges, this has no effect.
Sourcepub fn get(&self, action: &A) -> Option<&Charges>
pub fn get(&self, action: &A) -> Option<&Charges>
Returns a reference to the underlying Charges for action, if set.
Sourcepub fn get_mut(&mut self, action: &A) -> Option<&mut Charges>
pub fn get_mut(&mut self, action: &A) -> Option<&mut Charges>
Returns a mutable reference to the underlying Charges for action, if set.
Sourcepub fn set(&mut self, action: A, charges: Charges) -> &mut Self
pub fn set(&mut self, action: A, charges: Charges) -> &mut Self
Sets the underlying Charges for action to the provided value.
Unless you’re building a new ChargeState struct, you likely want to use Self::get_mut.
Sourcepub fn build(&mut self) -> Self
pub fn build(&mut self) -> Self
Collects a &mut Self into a Self.
Used to conclude the builder pattern. Actually just calls self.clone().
Trait Implementations§
Source§impl<A: Clone + Abilitylike> Clone for ChargeState<A>
impl<A: Clone + Abilitylike> Clone for ChargeState<A>
Source§impl<A: Abilitylike> Component for ChargeState<A>
impl<A: Abilitylike> Component for ChargeState<A>
Source§const STORAGE_TYPE: StorageType = ::bevy::ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = ::bevy::ecs::component::StorageType::Table
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
ComponentRelationshipAccessor required for working with relationships in dynamic contexts. Read moreSource§fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreSource§impl<A: Debug + Abilitylike> Debug for ChargeState<A>
impl<A: Debug + Abilitylike> Debug for ChargeState<A>
Source§impl<A: Abilitylike> Default for ChargeState<A>
impl<A: Abilitylike> Default for ChargeState<A>
impl<A: Eq + Abilitylike> Eq for ChargeState<A>
Source§impl<A> FromReflect for ChargeState<A>where
ChargeState<A>: Any + Send + Sync,
A: TypePath + Abilitylike,
HashMap<A, Charges>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl<A> FromReflect for ChargeState<A>where
ChargeState<A>: Any + Send + Sync,
A: TypePath + Abilitylike,
HashMap<A, Charges>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn from_reflect(reflect: &dyn PartialReflect) -> Option<Self>
fn from_reflect(reflect: &dyn PartialReflect) -> Option<Self>
Self from a reflected value.Source§fn take_from_reflect(
reflect: Box<dyn PartialReflect>,
) -> Result<Self, Box<dyn PartialReflect>>
fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>
Self using,
constructing the value using from_reflect if that fails. Read moreSource§impl<A> GetTypeRegistration for ChargeState<A>where
ChargeState<A>: Any + Send + Sync,
A: TypePath + Abilitylike,
HashMap<A, Charges>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl<A> GetTypeRegistration for ChargeState<A>where
ChargeState<A>: Any + Send + Sync,
A: TypePath + Abilitylike,
HashMap<A, Charges>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn get_type_registration() -> TypeRegistration
fn get_type_registration() -> TypeRegistration
TypeRegistration for this type.Source§fn register_type_dependencies(registry: &mut TypeRegistry)
fn register_type_dependencies(registry: &mut TypeRegistry)
Source§impl<A: PartialEq + Abilitylike> PartialEq for ChargeState<A>
impl<A: PartialEq + Abilitylike> PartialEq for ChargeState<A>
Source§impl<A> PartialReflect for ChargeState<A>where
ChargeState<A>: Any + Send + Sync,
A: TypePath + Abilitylike,
HashMap<A, Charges>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl<A> PartialReflect for ChargeState<A>where
ChargeState<A>: Any + Send + Sync,
A: TypePath + Abilitylike,
HashMap<A, Charges>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
Source§fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError>
fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError>
Source§fn reflect_kind(&self) -> ReflectKind
fn reflect_kind(&self) -> ReflectKind
Source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
Source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Source§fn reflect_owned(self: Box<Self>) -> ReflectOwned
fn reflect_owned(self: Box<Self>) -> ReflectOwned
Source§fn try_into_reflect(
self: Box<Self>,
) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
fn try_into_reflect( self: Box<Self>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
Source§fn try_as_reflect(&self) -> Option<&dyn Reflect>
fn try_as_reflect(&self) -> Option<&dyn Reflect>
Source§fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect>
fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect>
Source§fn into_partial_reflect(self: Box<Self>) -> Box<dyn PartialReflect>
fn into_partial_reflect(self: Box<Self>) -> Box<dyn PartialReflect>
Source§fn as_partial_reflect(&self) -> &dyn PartialReflect
fn as_partial_reflect(&self) -> &dyn PartialReflect
Source§fn as_partial_reflect_mut(&mut self) -> &mut dyn PartialReflect
fn as_partial_reflect_mut(&mut self) -> &mut dyn PartialReflect
Source§fn reflect_partial_eq(&self, value: &dyn PartialReflect) -> Option<bool>
fn reflect_partial_eq(&self, value: &dyn PartialReflect) -> Option<bool>
Source§fn reflect_partial_cmp(&self, value: &dyn PartialReflect) -> Option<Ordering>
fn reflect_partial_cmp(&self, value: &dyn PartialReflect) -> Option<Ordering>
Source§fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
Self using reflection. Read moreSource§fn apply(&mut self, value: &(dyn PartialReflect + 'static))
fn apply(&mut self, value: &(dyn PartialReflect + 'static))
Source§fn to_dynamic(&self) -> Box<dyn PartialReflect>
fn to_dynamic(&self) -> Box<dyn PartialReflect>
Source§fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
PartialReflect, combines reflect_clone and
take in a useful fashion, automatically constructing an appropriate
ReflectCloneError if the downcast fails.Source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Source§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Source§impl<A> Reflect for ChargeState<A>where
ChargeState<A>: Any + Send + Sync,
A: TypePath + Abilitylike,
HashMap<A, Charges>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl<A> Reflect for ChargeState<A>where
ChargeState<A>: Any + Send + Sync,
A: TypePath + Abilitylike,
HashMap<A, Charges>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
&mut dyn Any. Read moreSource§fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
Source§fn as_reflect(&self) -> &dyn Reflect
fn as_reflect(&self) -> &dyn Reflect
Source§fn as_reflect_mut(&mut self) -> &mut dyn Reflect
fn as_reflect_mut(&mut self) -> &mut dyn Reflect
Source§impl<A> Struct for ChargeState<A>where
ChargeState<A>: Any + Send + Sync,
A: TypePath + Abilitylike,
HashMap<A, Charges>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl<A> Struct for ChargeState<A>where
ChargeState<A>: Any + Send + Sync,
A: TypePath + Abilitylike,
HashMap<A, Charges>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn field(&self, name: &str) -> Option<&dyn PartialReflect>
fn field(&self, name: &str) -> Option<&dyn PartialReflect>
name as a &dyn PartialReflect.Source§fn field_mut(&mut self, name: &str) -> Option<&mut dyn PartialReflect>
fn field_mut(&mut self, name: &str) -> Option<&mut dyn PartialReflect>
name as a
&mut dyn PartialReflect.Source§fn field_at(&self, index: usize) -> Option<&dyn PartialReflect>
fn field_at(&self, index: usize) -> Option<&dyn PartialReflect>
index as a
&dyn PartialReflect.Source§fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn PartialReflect>
fn field_at_mut(&mut self, index: usize) -> Option<&mut dyn PartialReflect>
index
as a &mut dyn PartialReflect.Source§fn index_of_name(&self, name: &str) -> Option<usize>
fn index_of_name(&self, name: &str) -> Option<usize>
Source§fn iter_fields(&self) -> FieldIter<'_> ⓘ
fn iter_fields(&self) -> FieldIter<'_> ⓘ
Source§fn to_dynamic_struct(&self) -> DynamicStruct
fn to_dynamic_struct(&self) -> DynamicStruct
DynamicStruct from this struct.Source§fn get_represented_struct_info(&self) -> Option<&'static StructInfo>
fn get_represented_struct_info(&self) -> Option<&'static StructInfo>
None if TypeInfo is not available.impl<A: PartialEq + Abilitylike> StructuralPartialEq for ChargeState<A>
Source§impl<A> TypePath for ChargeState<A>
impl<A> TypePath for ChargeState<A>
Source§fn type_path() -> &'static str
fn type_path() -> &'static str
Source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
Source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
Source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
Source§impl<A> Typed for ChargeState<A>where
ChargeState<A>: Any + Send + Sync,
A: TypePath + Abilitylike,
HashMap<A, Charges>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl<A> Typed for ChargeState<A>where
ChargeState<A>: Any + Send + Sync,
A: TypePath + Abilitylike,
HashMap<A, Charges>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Auto Trait Implementations§
impl<A> Forget for ChargeState<A>
impl<A> Freeze for ChargeState<A>
impl<A> Move for ChargeState<A>
impl<A> RefUnwindSafe for ChargeState<A>
impl<A> Send for ChargeState<A>
impl<A> Sync for ChargeState<A>
impl<A> Unpin for ChargeState<A>
impl<A> UnsafeUnpin for ChargeState<A>
impl<A> UnwindSafe for ChargeState<A>
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<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>
Source§fn get_component_ids(
components: &Components,
) -> impl Iterator<Item = Option<ComponentId>>
fn get_component_ids( components: &Components, ) -> impl Iterator<Item = Option<ComponentId>>
Source§impl<C> BundleFromComponents for Cwhere
C: Component,
impl<C> BundleFromComponents for Cwhere
C: Component,
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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
Source§unsafe fn get_components(
ptr: MovingPtr<'_, C>,
func: &mut impl FnMut(StorageType, OwningPtr<'_>),
) -> <C as DynamicBundle>::Effect
unsafe fn get_components( ptr: MovingPtr<'_, C>, func: &mut impl FnMut(StorageType, OwningPtr<'_>), ) -> <C as DynamicBundle>::Effect
Source§unsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
Source§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere
T: TypePath,
Source§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path.Source§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
Source§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident.Source§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name.Source§fn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
Source§impl<T> DynamicTyped for Twhere
T: Typed,
impl<T> DynamicTyped for Twhere
T: Typed,
Source§fn reflect_type_info(&self) -> &'static TypeInfo
fn reflect_type_info(&self) -> &'static TypeInfo
Typed::type_info.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FromTemplate for T
impl<T> FromTemplate for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<S> GetField for Swhere
S: Struct,
impl<S> GetField for Swhere
S: Struct,
Source§impl<T> GetPath for T
impl<T> GetPath for T
Source§fn reflect_path<'p>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
path. Read moreSource§fn reflect_path_mut<'p>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
path. Read moreSource§fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
path. Read moreSource§fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
path. Read moreSource§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>
impl<T> Reflectable for T
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.