pub struct StyleOverrides { /* private fields */ }Expand description
The values runtime systems hold on one element; see the module docs.
Carried by every element a holder can act on (its marker components require it), so a holder writes here in place rather than through a deferred insert another holder could race.
Implementations§
Source§impl StyleOverrides
impl StyleOverrides
Sourcepub fn held(&self) -> StyleFields
pub fn held(&self) -> StyleFields
Every field some holder holds.
Sourcepub fn held_by<O: StyleOwner>(&self) -> Option<&StyleValues>
pub fn held_by<O: StyleOwner>(&self) -> Option<&StyleValues>
What O holds, if anything.
Sourcepub fn resting(&self) -> &StyleValues
pub fn resting(&self) -> &StyleValues
What the cascade resolved for the held fields.
Sourcepub fn hold<O: StyleOwner>(
&mut self,
values: StyleValues,
live: &Live<'_>,
) -> StyleValues
pub fn hold<O: StyleOwner>( &mut self, values: StyleValues, live: &Live<'_>, ) -> StyleValues
Hold values for O, replacing whatever O held before.
live is read for a field nobody held yet: until then the live
value is the cascade’s. Returns the composed value of every field
whose top layer may have moved (what O held before and holds now),
to write onto the live components.
Sourcepub fn release<O: StyleOwner>(&mut self) -> StyleValues
pub fn release<O: StyleOwner>(&mut self) -> StyleValues
Stop holding anything for O. Returns the composed value of every
field it held, which for a field nobody else holds is the cascade’s,
to write onto the live components.
Sourcepub fn below<O: StyleOwner>(
&self,
fields: StyleFields,
live: &Live<'_>,
) -> StyleValues
pub fn below<O: StyleOwner>( &self, fields: StyleFields, live: &Live<'_>, ) -> StyleValues
The value of fields under O’s layer: the cascade’s, with every
lower-ranked holder laid over it. A field nobody holds reads live.
Sourcepub fn rebase(&mut self, fresh: &StyleValues) -> StyleValues
pub fn rebase(&mut self, fresh: &StyleValues) -> StyleValues
Record what a restyle resolved: fresh is the cascade’s value for
every field. Returns the composed value of every held field, to lay
over fresh before it is written onto the live components.
Trait Implementations§
Source§impl Clone for StyleOverrides
impl Clone for StyleOverrides
Source§fn clone(&self) -> StyleOverrides
fn clone(&self) -> StyleOverrides
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Component for StyleOverrides
impl Component for StyleOverrides
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_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 moreSource§impl Debug for StyleOverrides
impl Debug for StyleOverrides
Source§impl Default for StyleOverrides
impl Default for StyleOverrides
Source§fn default() -> StyleOverrides
fn default() -> StyleOverrides
Auto Trait Implementations§
impl Freeze for StyleOverrides
impl RefUnwindSafe for StyleOverrides
impl Send for StyleOverrides
impl Sync for StyleOverrides
impl Unpin for StyleOverrides
impl UnsafeUnpin for StyleOverrides
impl UnwindSafe for StyleOverrides
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.