pub struct RenderTreeContext<'a, R: 'static + RenderContext> {
    pub engine: &'a PaxEngine<R>,
    pub transform_global: Affine,
    pub transform_scroller_reset: Affine,
    pub bounds: (f64, f64),
    pub runtime: Rc<RefCell<Runtime<R>>>,
    pub node: RenderNodePtr<R>,
    pub parent_repeat_expanded_node: Option<Weak<RepeatExpandedNode<R>>>,
    pub timeline_playhead_position: usize,
    pub inherited_adoptees: Option<RenderNodePtrList<R>>,
}

Fields§

§engine: &'a PaxEngine<R>§transform_global: Affine§transform_scroller_reset: Affine§bounds: (f64, f64)§runtime: Rc<RefCell<Runtime<R>>>§node: RenderNodePtr<R>§parent_repeat_expanded_node: Option<Weak<RepeatExpandedNode<R>>>§timeline_playhead_position: usize§inherited_adoptees: Option<RenderNodePtrList<R>>

Implementations§

source§

impl<'a, R: 'static + RenderContext> RenderTreeContext<'a, R>

source§

impl<'a, R: RenderContext> RenderTreeContext<'a, R>

source

pub fn compute_eased_value<T: Clone + Interpolatable>( &self, transition_manager: Option<&mut TransitionManager<T>> ) -> Option<T>

source

pub fn get_id_chain(&self, id: u32) -> Vec<u32>

Get an id_chain for this element, an array of u64 used collectively as a single unique ID across native bridges. Specifically, the ID chain represents not only the instance ID, but the indices of each RepeatItem found by a traversal of the runtime stack.

The need for this emerges from the fact that Repeated elements share a single underlying instance, where that instantiation happens once at init-time — specifically, it does not happen when Repeated elements are added and removed to the render tree. 10 apparent rendered elements may share the same instance_id – which doesn’t work as a unique key for native renderers that are expected to render and update 10 distinct elements.

Thus, the id_chain is used as a unique key, first the instance_id (which will increase monotonically through the lifetime of the program), then each RepeatItem index through a traversal of the stack frame. Thus, each virtually Repeated element gets its own unique ID in the form of an “address” through any nested Repeat-ancestors.

source

pub fn compute_vtable_value( &self, vtable_id: Option<usize> ) -> Option<TypesCoproduct>

Trait Implementations§

source§

impl<'a, R: 'static + RenderContext> Clone for RenderTreeContext<'a, R>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'a, R> !RefUnwindSafe for RenderTreeContext<'a, R>

§

impl<'a, R> !Send for RenderTreeContext<'a, R>

§

impl<'a, R> !Sync for RenderTreeContext<'a, R>

§

impl<'a, R> Unpin for RenderTreeContext<'a, R>

§

impl<'a, R> !UnwindSafe for RenderTreeContext<'a, R>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> RoundFrom<T> for T

source§

fn round_from(x: T) -> T

Performs the conversion.
source§

impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,

source§

fn round_into(self) -> U

Performs the conversion.
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.