Struct bevy_stat_query::BaseStatMap

source ·
pub struct BaseStatMap<Q: QualifierFlag>(/* private fields */);
Expand description

A map containing associated output value of stats.

Implementations§

source§

impl<Q: QualifierFlag> BaseStatMap<Q>

source

pub fn new() -> Self

source

pub fn unqualified(&self) -> &Unqualified<Self>

Obtain an unqualified view.

source

pub fn unqualified_mut(&mut self) -> &mut Unqualified<Self>

Obtain an mutable unqualified view.

source

pub fn clear(&mut self)

source

pub fn insert<S: Stat>( &mut self, qualifier: Qualifier<Q>, stat: S, value: <<S as Stat>::Data as StatValue>::Out )

source

pub fn get<S: Stat>( &self, qualifier: &Qualifier<Q>, stat: &S ) -> Option<&<<S as Stat>::Data as StatValue>::Out>

source

pub fn get_mut<S: Stat>( &mut self, qualifier: &Qualifier<Q>, stat: &S ) -> Option<&mut <<S as Stat>::Data as StatValue>::Out>

source

pub fn remove<S: Stat>( &mut self, qualifier: &Qualifier<Q>, stat: &S ) -> Option<<<S as Stat>::Data as StatValue>::Out>

source

pub fn retain(&mut self, f: impl FnMut(&Qualifier<Q>, &dyn Any) -> bool)

source

pub fn iter<S: Stat>( &self, stat: &S ) -> impl Iterator<Item = (&Qualifier<Q>, &<<S as Stat>::Data as StatValue>::Out)>

Iterate over a particular stat.

source

pub fn iter_mut<S: Stat>( &mut self, stat: &S ) -> impl Iterator<Item = (&Qualifier<Q>, &mut <<S as Stat>::Data as StatValue>::Out)>

Iterate over a particular stat.

source§

impl<Q: QualifierFlag> BaseStatMap<Q>

source

pub fn modify<S: Stat>( &mut self, qualifier: &Qualifier<Q>, stat: &S, f: impl FnOnce(&mut <<S as Stat>::Data as StatValue>::Out) )

Trait Implementations§

source§

impl<Q: Clone + QualifierFlag> Clone for BaseStatMap<Q>

source§

fn clone(&self) -> BaseStatMap<Q>

Returns a copy 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<Q: QualifierFlag> Component for BaseStatMap<Q>
where Self: Send + Sync + 'static,

§

type Storage = TableStorage

A marker type indicating the storage type used for this component. This must be either TableStorage or SparseStorage.
source§

impl<Q: Debug + QualifierFlag> Debug for BaseStatMap<Q>

source§

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

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

impl<Q: Default + QualifierFlag> Default for BaseStatMap<Q>

source§

fn default() -> BaseStatMap<Q>

Returns the “default value” for a type. Read more
source§

impl<Q: QualifierFlag> ExternalStream<Q> for BaseStatMap<Q>

§

type Ctx = ()

§

type QueryData = Option<&'static BaseStatMap<Q>>

source§

fn stream( _: &<Self::Ctx as SystemParam>::Item<'_, '_>, this: <Self::QueryData as WorldQuery>::Item<'_>, qualifier: &QualifierQuery<Q>, pair: &mut StatValuePair<'_>, _: &mut QuerierRef<'_, Q> )

source§

impl<Q: QualifierFlag> IntrinsicStream<Q> for BaseStatMap<Q>

source§

fn distance( _: &<Self::Ctx as SystemParam>::Item<'_, '_>, _: <Self::QueryData as WorldQuery>::Item<'_>, _: <Self::QueryData as WorldQuery>::Item<'_>, _: &QualifierQuery<Q>, _: &mut StatValuePair<'_>, _: &mut QuerierRef<'_, Q> )

Write to stat and return true if a value is written.
source§

impl<Q: QualifierFlag + SerdeProject> SerdeProject for BaseStatMap<Q>

§

type Ctx = WorldAccess

Context fetched from the World.
§

type Ser<'t> = Vec<SerEntry<'t, Q>>

A Serialize type.
§

type De<'de> = Vec<DeEntry<'de, Q>>

A Deserialize type.
source§

fn to_ser<'t>(&'t self, ctx: &&'t World) -> Result<Self::Ser<'t>, Box<Error>>

Convert to a Serialize type.
source§

fn from_de(ctx: &mut &mut World, de: Self::De<'_>) -> Result<Self, Box<Error>>

Convert from a Deserialize type.
source§

impl<Q: QualifierFlag> StatelessStream<Q> for BaseStatMap<Q>

source§

fn stat_extend( &self, qualifier: &QualifierQuery<Q>, pair: &mut StatValuePair<'_> )

source§

impl<Q> TypePath for BaseStatMap<Q>
where Self: Any + Send + Sync, Q: TypePath + QualifierFlag,

source§

fn type_path() -> &'static str

Returns the fully qualified path of the underlying type. Read more
source§

fn short_type_path() -> &'static str

Returns a short, pretty-print enabled path to the type. Read more
source§

fn type_ident() -> Option<&'static str>

Returns the name of the type, or None if it is anonymous. Read more
source§

fn crate_name() -> Option<&'static str>

Returns the name of the crate the type is in, or None if it is anonymous. Read more
source§

fn module_path() -> Option<&'static str>

Returns the path to the module the type is in, or None if it is anonymous. Read more

Auto Trait Implementations§

§

impl<Q> Freeze for BaseStatMap<Q>

§

impl<Q> !RefUnwindSafe for BaseStatMap<Q>

§

impl<Q> Send for BaseStatMap<Q>

§

impl<Q> Sync for BaseStatMap<Q>

§

impl<Q> Unpin for BaseStatMap<Q>

§

impl<Q> !UnwindSafe for BaseStatMap<Q>

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

§

type Ser<'t> = <T as SerdeProject>::Ser<'t> where T: 't

§

type De<'de> = <T as SerdeProject>::De<'de>

source§

fn to_ser( world: &World, entity: Entity ) -> Result<Option<<T as BevyObject>::Ser<'_>>, Box<Error>>

Convert to a Serialize type, returns None only if the entity is not found.
source§

fn from_de( world: &mut World, entity: Entity, de: <T as BevyObject>::De<'_> ) -> Result<(), Box<Error>>

Convert from a Deserialize type.
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<C> Bundle for C
where C: Component,

source§

fn component_ids( components: &mut Components, storages: &mut Storages, ids: &mut impl FnMut(ComponentId) )

source§

unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> C
where F: for<'a> FnMut(&'a mut T) -> OwningPtr<'a>,

source§

impl<T> Convert<T> for T

source§

fn ser(input: &T) -> &T

Convert a reference to a SerdeProject type’s reference. Read more
source§

fn de(self) -> T

Convert this SerdeProject type back to the original.
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> DowncastSync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

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

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<C> DynamicBundle for C
where C: Component,

source§

fn get_components(self, func: &mut impl FnMut(StorageType, OwningPtr<'_>))

source§

impl<T> DynamicTypePath for T
where T: TypePath,

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromWorld for T
where T: Default,

source§

fn from_world(_world: &mut World) -> T

Creates Self using data from the given World.
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, Q> StatStream<Q> for T

source§

fn stream( &self, qualifier: &QualifierQuery<Q>, stat: &mut StatValuePair<'_>, _: &mut QuerierRef<'_, Q> )

source§

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

§

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

§

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

§

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<T> TypeData for T
where T: 'static + Send + Sync + Clone,

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> Settings for T
where T: 'static + Send + Sync,

source§

impl<T> Shareable for T
where T: Clone + Debug + Send + Sync + 'static,