Skip to main content

SystemStyleDependencies

Struct SystemStyleDependencies 

Source
#[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: u32

Bitmask over SystemStyleDependency::bit. 0 = nothing declared, which is NOT “depends on nothing” — see Self::dom_depends_on_change.

Implementations§

Source§

impl SystemStyleDependencies

Source

pub const fn empty() -> Self

Nothing declared.

Source

pub const fn all() -> Self

Every facet — what an undeclared callback is treated as.

Source

pub const fn is_empty(&self) -> bool

Nothing has been declared yet.

Source

pub const fn insert(&mut self, dep: SystemStyleDependency)

Fold one facet in.

Source

pub const fn union(&mut self, other: Self)

Fold another set in.

Source

pub const fn contains(&self, dep: SystemStyleDependency) -> bool

Was dep declared? Everything implies every facet.

Source

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

Source§

fn clone(&self) -> SystemStyleDependencies

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SystemStyleDependencies

Source§

impl Debug for SystemStyleDependencies

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SystemStyleDependencies

Source§

fn default() -> SystemStyleDependencies

Returns the “default value” for a type. Read more
Source§

impl Eq for SystemStyleDependencies

Source§

impl Hash for SystemStyleDependencies

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SystemStyleDependencies

Source§

fn eq(&self, other: &SystemStyleDependencies) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SystemStyleDependencies

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GetHash for T
where T: Hash,

Source§

fn get_hash(&self) -> u64

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.