Skip to main content

BasicModifierNodeContext

Struct BasicModifierNodeContext 

Source
pub struct BasicModifierNodeContext { /* private fields */ }
Expand description

Lightweight ModifierNodeContext implementation that records invalidation requests and update signals.

The context intentionally avoids leaking runtime details so the core crate can evolve independently from higher level UI crates. It simply stores the sequence of requested invalidation kinds and whether an explicit update was requested. Callers can inspect or drain this state after driving a ModifierNodeChain reconciliation pass.

Implementations§

Source§

impl BasicModifierNodeContext

Source

pub fn new() -> Self

Creates a new empty context.

Source

pub fn invalidations(&self) -> &[ModifierInvalidation]

Returns the ordered list of invalidation kinds that were requested since the last call to [clear_invalidations]. Duplicate requests for the same kind are coalesced.

Source

pub fn clear_invalidations(&mut self)

Removes all currently recorded invalidation kinds.

Source

pub fn take_invalidations(&mut self) -> Vec<ModifierInvalidation>

Drains the recorded invalidations and returns them to the caller.

Source

pub fn update_requested(&self) -> bool

Returns whether an update was requested since the last call to [take_update_requested].

Source

pub fn take_update_requested(&mut self) -> bool

Returns whether an update was requested and clears the flag.

Source

pub fn set_node_id(&mut self, id: Option<NodeId>)

Sets the node ID associated with this context.

Trait Implementations§

Source§

impl Clone for BasicModifierNodeContext

Source§

fn clone(&self) -> BasicModifierNodeContext

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for BasicModifierNodeContext

Source§

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

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

impl Default for BasicModifierNodeContext

Source§

fn default() -> BasicModifierNodeContext

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

impl ModifierNodeContext for BasicModifierNodeContext

Source§

fn invalidate(&mut self, kind: InvalidationKind)

Requests that a particular pipeline stage be invalidated.
Source§

fn request_update(&mut self)

Requests that the node’s update method run again outside of a regular composition pass.
Source§

fn push_active_capabilities(&mut self, capabilities: NodeCapabilities)

Signals that a node with capabilities is about to interact with this context.
Source§

fn pop_active_capabilities(&mut self)

Signals that the most recent node interaction has completed.
Source§

fn node_id(&self) -> Option<NodeId>

Returns the ID of the layout node this modifier is attached to, if known. This is used by modifiers that need to register callbacks for invalidation (e.g. Scroll).

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, 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.