pub struct RetainedTree {
pub taffy: TaffyTree<()>,
pub root: Option<RetainedNode>,
pub layout_dirty: bool,
}Expand description
Mutable UI tree synchronized with Taffy layout nodes and Vello paint data.
Built from an Element via mount, then updated with
patches from Runtime::take_patches. run
manages this internally; use it directly in integration tests or custom hosts.
Fields§
§taffy: TaffyTree<()>Shared Taffy tree backing flex layout for this UI.
root: Option<RetainedNode>Root retained node, if mount succeeded.
layout_dirty: boolWhen true, layout_pass should run before painting.
Implementations§
Source§impl RetainedTree
impl RetainedTree
Sourcepub fn text_needs_reflow(&self) -> bool
pub fn text_needs_reflow(&self) -> bool
Returns true if any text node still needs a layout pass (e.g. after UpdateText).
Sourcepub fn mount(element: Element) -> Result<Self, RetainedError>
pub fn mount(element: Element) -> Result<Self, RetainedError>
Builds the initial retained tree from a frozen element tree (e.g. Runtime::root_element).
Sourcepub fn apply_patches(
&mut self,
patches: impl IntoIterator<Item = Patch>,
) -> Result<(), RetainedError>
pub fn apply_patches( &mut self, patches: impl IntoIterator<Item = Patch>, ) -> Result<(), RetainedError>
Applies a batch of diff patches and marks layout dirty.
pub fn apply_patch(&mut self, patch: Patch) -> Result<(), RetainedError>
Trait Implementations§
Source§impl Debug for RetainedTree
impl Debug for RetainedTree
Auto Trait Implementations§
impl Freeze for RetainedTree
impl !RefUnwindSafe for RetainedTree
impl !Send for RetainedTree
impl !Sync for RetainedTree
impl Unpin for RetainedTree
impl UnsafeUnpin for RetainedTree
impl !UnwindSafe for RetainedTree
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
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.