Skip to main content

WidgetTreeCache

Struct WidgetTreeCache 

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

Previous/current frame cache for widget tree nodes.

Layout and interaction are stored in separate generations so pass 1 can read only previous-frame geometry while pass 3 writes the next frame’s geometry and interaction outputs independently.

Implementations§

Source§

impl WidgetTreeCache

Source

pub fn begin_frame(&mut self)

Clears the in-progress frame cache while preserving the committed frame.

Source

pub fn finish_frame(&mut self)

Publishes the current frame cache as the previous frame for the next run.

Source

pub fn clear(&mut self)

Drops both previous and current cached node data.

Source

pub fn prev_layout(&self, node_id: NodeId) -> Option<&NodeLayout>

Returns the previous frame layout for node_id.

Source

pub fn current_layout(&self, node_id: NodeId) -> Option<&NodeLayout>

Returns the current frame layout for node_id.

Source

pub fn prev_interaction(&self, node_id: NodeId) -> Option<&NodeInteraction>

Returns the previous frame interaction for node_id.

Source

pub fn current_interaction(&self, node_id: NodeId) -> Option<&NodeInteraction>

Returns the current frame interaction for node_id.

Source

pub fn prev_state(&self, node_id: NodeId) -> Option<NodeFrameState>

Returns the previous combined frame state for node_id.

Source

pub fn current_state(&self, node_id: NodeId) -> Option<NodeFrameState>

Returns the current combined frame state for node_id.

Source

pub fn record_layout(&mut self, node_id: NodeId, layout: NodeLayout)

Records the current frame layout for node_id.

Source

pub fn record_interaction( &mut self, node_id: NodeId, interaction: NodeInteraction, )

Records the current frame interaction for node_id.

Trait Implementations§

Source§

impl Default for WidgetTreeCache

Source§

fn default() -> WidgetTreeCache

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

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> 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, 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.