pub struct UiBindingStore {
pub data: HashMap<String, UiBindingEntry>,
/* private fields */
}Expand description
Reactive store used by the extended framework.
Values are addressed by string keys and are stored type-erased so primitive values, strings, booleans, structs, enums, and other serializable Rust values can share the same resource. The store maintains its own revision counter; the revision only changes when a setter stores a different value.
Fields§
§data: HashMap<String, UiBindingEntry>Keyed store data. Use the provided setter methods so revisions stay accurate and the UI only rebuilds after real value changes.
Implementations§
Source§impl UiBindingStore
impl UiBindingStore
Sourcepub fn register<T: BeuStore>(&mut self) -> bool
pub fn register<T: BeuStore>(&mut self) -> bool
Registers a #[derive(BeuStore)] type without requiring a value.
Sourcepub fn register_type<T: Send + Sync + 'static>(
&mut self,
key: &'static str,
path: &'static str,
) -> bool
pub fn register_type<T: Send + Sync + 'static>( &mut self, key: &'static str, path: &'static str, ) -> bool
Registers a type under an explicit key and path.
Sourcepub fn set<T>(&mut self, key: impl Into<String>, value: T) -> boolwhere
T: UiBindingStoredValue + Serialize,
pub fn set<T>(&mut self, key: impl Into<String>, value: T) -> boolwhere
T: UiBindingStoredValue + Serialize,
Sets a serializable value under a string key.
Returns true only when the stored value actually changed.
Sourcepub fn set_store<T>(&mut self, value: T) -> bool
pub fn set_store<T>(&mut self, value: T) -> bool
Sets a serializable value for a #[derive(BeuStore)] type.
Returns true only when the stored value actually changed.
Sourcepub fn set_raw<T>(&mut self, key: impl Into<String>, value: T) -> boolwhere
T: UiBindingStoredValue,
pub fn set_raw<T>(&mut self, key: impl Into<String>, value: T) -> boolwhere
T: UiBindingStoredValue,
Sets a non-serializable value under a string key.
Raw values can be read back through typed getters but are not visible to template interpolation because no JSON representation is available.
Sourcepub fn get<T: 'static>(&self, key: &str) -> Option<&T>
pub fn get<T: 'static>(&self, key: &str) -> Option<&T>
Returns a typed value stored under a key.
Sourcepub fn get_store<T: BeuStore>(&self) -> Option<&T>
pub fn get_store<T: BeuStore>(&self) -> Option<&T>
Returns a typed value stored for a #[derive(BeuStore)] type.
Sourcepub fn json_path(&self, path: &str) -> Option<JsonValue>
pub fn json_path(&self, path: &str) -> Option<JsonValue>
Returns a template-visible JSON value from a dot-separated binding path.
Sourcepub fn set_path_json(&mut self, path: &str, value: JsonValue) -> bool
pub fn set_path_json(&mut self, path: &str, value: JsonValue) -> bool
Sets a template-visible value through a dot-separated binding path.
Direct primitive keys keep their registered Rust type (bool, strings,
all common integer widths, usize/isize, f32, f64). Nested paths
update the stored JSON projection so templates can react immediately.
Sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Returns whether a key is registered in the store.
Sourcepub fn known_types(&self) -> impl Iterator<Item = &str>
pub fn known_types(&self) -> impl Iterator<Item = &str>
Returns all known type names and paths registered with the store.
Sourcepub fn template_values(&self) -> Vec<(String, JsonValue)>
pub fn template_values(&self) -> Vec<(String, JsonValue)>
Returns serializable store values for the template shared-value pipeline.
Trait Implementations§
Source§impl Component for UiBindingStore
impl Component for UiBindingStore
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 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 Default for UiBindingStore
impl Default for UiBindingStore
Source§fn default() -> UiBindingStore
fn default() -> UiBindingStore
impl Resource for UiBindingStore
Auto Trait Implementations§
impl !RefUnwindSafe for UiBindingStore
impl !UnwindSafe for UiBindingStore
impl Freeze for UiBindingStore
impl Send for UiBindingStore
impl Sync for UiBindingStore
impl Unpin for UiBindingStore
impl UnsafeUnpin for UiBindingStore
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
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,
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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
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<'_>, )
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> ErasedDestructor for Twhere
T: 'static,
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<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 more