Skip to main content

Tree

Struct Tree 

Source
pub struct Tree<C: Context> { /* private fields */ }

Implementations§

Source§

impl<C: Context> Tree<C>

Source

pub fn build<W: Widget<C>>( &mut self, context: &mut C, info: FrameInfo<C::Scalar>, time: Duration, input: Input<C::Scalar>, widget: W, ) -> W::Response

rebuilds the tree for one input

call Self::layout after every build, as the next build reads that layout

Source

pub fn layout(&mut self, context: &mut C)

resolves layout, positioning, clipping and interaction for the built tree

Source

pub fn paint( &mut self, context: &mut C, push_clip: impl FnMut(&mut C, Rect<C::Scalar>, Corners<C::Scalar>), pop_clip: impl FnMut(&mut C), )

paints the resolved tree and releases its retained values

Source

pub fn has_pending_redraw(&self) -> bool

Source

pub fn next_timer_deadline(&self) -> Option<Duration>

Source

pub fn request_frame(&mut self)

Source

pub fn area(&self, id: Id) -> Option<Rect<C::Scalar>>

returns the area of the node with id in the latest layout

valid after Self::layout

Source

pub fn find(&self, scope: Scope, key: impl Key) -> Option<Id>

the id keyed key in scope, if anything holds it

Trait Implementations§

Source§

impl<C: Context> Default for Tree<C>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<C> !Freeze for Tree<C>

§

impl<C> !RefUnwindSafe for Tree<C>

§

impl<C> !Send for Tree<C>

§

impl<C> !Sync for Tree<C>

§

impl<C> Forget for Tree<C>

§

impl<C> Move for Tree<C>

§

impl<C> Unpin for Tree<C>
where *const u8 is !null: Unpin, NonZero<u32>: Unpin, &'static Location<'static>: Unpin, <C as Context>::Scalar: Unpin, *mut (): Unpin, *const (): Unpin,

§

impl<C> UnsafeUnpin for Tree<C>

§

impl<C> UnwindSafe for Tree<C>

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 = !

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.