pub struct Signals {
pub values: HashMap<String, String>,
pub dirty: HashSet<String>,
}use lumen_core::property_store::PropertyStore instead - Signals is now a thin wrapper that mirrors writes through push_external_property and reads from the typed store. New systems should take Res<PropertyStore> / ResMut<PropertyStore>.
Expand description
Legacy reactive named-value store. Deprecated as of wave-D - internal lumen
systems now read/write through PropertyStore keyed on PropertyKey::Global.
The struct is retained as a thin wrapper so external embedders and FFI consumers that
still hold Res<Signals> references compile and continue working: set writes through
to PropertyStore via the cross-thread push_external_property bus AND keeps a
local string copy for the legacy &str-returning get signature, and a per-tick
mirror system back-fills writes that landed directly on PropertyStore so
signals.get(name) keeps surfacing the latest value regardless of which side wrote it.
The dirty field is still populated by Signals::set for legacy derive-style callers,
but new code should call PropertyStore::dirty_global_names instead.
Fieldsยง
ยงvalues: HashMap<String, String>use lumen_core::property_store::PropertyStore instead - Signals is now a thin wrapper that mirrors writes through push_external_property and reads from the typed store. New systems should take Res<PropertyStore> / ResMut<PropertyStore>.
Stringified reactive signal values keyed by name. Populated by Self::set
and by the per-tick mirror_property_store_globals_to_signals back-mirror
so legacy &str-returning get callers keep working post wave-D.
dirty: HashSet<String>use lumen_core::property_store::PropertyStore instead - Signals is now a thin wrapper that mirrors writes through push_external_property and reads from the typed store. New systems should take Res<PropertyStore> / ResMut<PropertyStore>.
Set of signal names whose value changed during this tick. Kept for the
apply_derivations legacy path; new derivation-style consumers should peek
PropertyStore::dirty_global_names instead.
Implementationsยง
Sourceยงimpl Signals
impl Signals
Sourcepub fn set(&mut self, name: impl Into<String>, value: impl Into<String>)
pub fn set(&mut self, name: impl Into<String>, value: impl Into<String>)
Sets the signal name to value. Writes through to PropertyStore via
the cross-thread push_external_property bus AND updates the local
values map so legacy Signals::get callers observe the write
synchronously. Records the name in Self::dirty when the value changed.
Sourcepub fn get(&self, name: &str) -> Option<&str>
pub fn get(&self, name: &str) -> Option<&str>
Returns the signalโs value, or None when undefined.
Sourcepub fn set_bool(&mut self, name: impl Into<String>, value: bool)
pub fn set_bool(&mut self, name: impl Into<String>, value: bool)
Typed convenience: stores value under name as "true" or
"false". The underlying repr is still a String (the
reactive store is type-erased), but funnelling boolean writes
through this helper means call sites canโt drift to "True",
"1", or other look-alike strings that the compilerโs
<if eq="true"> body comparator wouldnโt recognise.
Sourcepub fn get_bool(&self, name: &str) -> Option<bool>
pub fn get_bool(&self, name: &str) -> Option<bool>
Typed convenience read for boolean signals written via
Self::set_bool. Accepts the canonical "true" / "false"
pair plus the common "1" / "0" alias for FFI / Rhai
authors. Returns None when the signal is undefined OR carries
a non-boolean value - the caller can then fall back to a
default rather than treating an unrelated string as false.
Trait Implementationsยง
Sourceยงimpl Component for Signals
impl Component for Signals
Sourceยงconst STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::SparseSet
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::SparseSet
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 moreยงfn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
ยงfn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
ยง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 moreimpl Resource for Signals
Auto Trait Implementationsยง
impl Freeze for Signals
impl RefUnwindSafe for Signals
impl Send for Signals
impl Sync for Signals
impl Unpin for Signals
impl UnsafeUnpin for Signals
impl UnwindSafe for Signals
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
ยง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ยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
ยงimpl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
ยง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
ยงunsafe fn apply_effect(
_ptr: MovingPtr<'_, MaybeUninit<C>>,
_entity: &mut EntityWorldMut<'_>,
)
unsafe fn apply_effect( _ptr: MovingPtr<'_, MaybeUninit<C>>, _entity: &mut EntityWorldMut<'_>, )
ยงimpl<T> FromTemplate for T
impl<T> FromTemplate for T
ยงimpl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
ยงfn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
ยงimpl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
ยงfn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
ยงimpl<T> Template for T
impl<T> Template for T
ยง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.ยงfn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.