pub struct IfMarker {
pub signal_name: String,
pub body: Vec<Element>,
pub currently_mounted: bool,
pub mode: IfMode,
pub eq: Option<String>,
pub applied_visible: Option<bool>,
}Expand description
Marker for an <if signal="..."> block. The reconciler mounts /
dismounts the subtree based on the named signal’s truthiness, or -
when Self::eq is Some- on value equality.
A hidden IfMode::Hide block holds display: none in
StyleOverrides (spec
section 17.4: space is released and the relayout comes free via
Changed<Style>), and lets go when it shows, so it shows with the
display its styles give it then.
Fields§
§signal_name: StringSignal name to evaluate.
body: Vec<Element>Markup children kept around as the body template - spawned when truthy, despawned when not.
currently_mounted: boolLast-known mount state so we can detect transitions cheaply.
mode: IfModeHow to handle the transition (despawn vs hide).
eq: Option<String>When Some(expected), mounts only when Signals[signal_name] == expected.
When None, mounts when Signals[signal_name] is non-empty and not literal "false"/"0".
applied_visible: Option<bool>IfMode::Hide only: the visibility state last applied to the
entity (None = never applied). The reconciler only touches
Style / Visible on a transition - re-inserting every tick
kept FrameDirty permanently set (D5).
Trait Implementations§
Source§impl Component for IfMarker
Required Components: [lumen_core :: style_overrides :: StyleOverrides].
impl Component for IfMarker
Required Components: [lumen_core :: style_overrides :: StyleOverrides].
A component’s Required Components are inserted whenever it is inserted. Note that this will also insert the required components of the required components, recursively, in depth-first order.
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 more§fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
on_add [ComponentHook] for this [Component] if one is defined.§fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
on_insert [ComponentHook] for this [Component] if one is defined.§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
on_discard [ComponentHook] for this [Component] if one is defined.§fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
on_remove [ComponentHook] for this [Component] if one is defined.§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
on_despawn [ComponentHook] for this [Component] if one is defined.§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 moreAuto Trait Implementations§
impl Freeze for IfMarker
impl RefUnwindSafe for IfMarker
impl Send for IfMarker
impl Sync for IfMarker
impl Unpin for IfMarker
impl UnsafeUnpin for IfMarker
impl UnwindSafe for IfMarker
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>
§fn get_component_ids(
components: &Components,
) -> impl Iterator<Item = Option<ComponentId>>
fn get_component_ids( components: &Components, ) -> impl Iterator<Item = Option<ComponentId>>
Bundle]’s component ids. This will be None if the component has not been registered.