#[repr(C)]pub struct SystemStyleDependencies {
pub facets: u32,
}Expand description
The set of SystemStyleDependency facets one layout() call declared.
A bitmask rather than a list: the facets are few, the union is the only operation, and it has to be cheap enough to fold on every declaration inside a deep widget tree.
Fields§
§facets: u32Bitmask over SystemStyleDependency::bit. 0 = nothing declared,
which is NOT “depends on nothing” — see
Self::dom_depends_on_change.
Implementations§
Source§impl SystemStyleDependencies
impl SystemStyleDependencies
Sourcepub const fn insert(&mut self, dep: SystemStyleDependency)
pub const fn insert(&mut self, dep: SystemStyleDependency)
Fold one facet in.
Sourcepub const fn contains(&self, dep: SystemStyleDependency) -> bool
pub const fn contains(&self, dep: SystemStyleDependency) -> bool
Was dep declared? Everything implies every facet.
Sourcepub fn dom_depends_on_change(
&self,
old: &SystemStyle,
new: &SystemStyle,
) -> bool
pub fn dom_depends_on_change( &self, old: &SystemStyle, new: &SystemStyle, ) -> bool
Would a system-style change from old to new alter what the
callback that declared these dependencies returns — i.e. does the
change need a full Update::RefreshDom, or only a restyle?
An EMPTY set answers true. “Declared nothing” is not “depends on
nothing”: it is the state of every callback written before this API
existed, and of every callback that reads the OS style through a
widget it does not control. Skipping their rebuild would leave the
previous palette baked into the DOM — a silent wrong-colours bug that
only a theme switch reveals. Declaring is opt-in; conservatism is the
default.
Trait Implementations§
Source§impl Clone for SystemStyleDependencies
impl Clone for SystemStyleDependencies
Source§fn clone(&self) -> SystemStyleDependencies
fn clone(&self) -> SystemStyleDependencies
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more