Struct pax_core::runtime::Runtime

source ·
pub struct Runtime<R: 'static + RenderContext> { /* private fields */ }
Expand description

Runtime is a container for data and logic needed by the Engine, explicitly aside from rendering. For example, this is a home for logic that manages scopes and stack frames.

Implementations§

source§

impl<R: 'static + RenderContext> Runtime<R>

source

pub fn new() -> Self

source

pub fn get_list_of_repeat_indicies_from_stack(&self) -> Vec<u32>

source

pub fn take_native_message_queue(&mut self) -> VecDeque<NativeMessage>

source

pub fn enqueue_native_message(&mut self, msg: NativeMessage)

source

pub fn peek_stack_frame(&mut self) -> Option<Rc<RefCell<StackFrame<R>>>>

Return a pointer to the top StackFrame on the stack, without mutating the stack or consuming the value

source

pub fn pop_stack_frame(&mut self)

Remove the top element from the stack. Currently does nothing with the value of the popped StackFrame.

source

pub fn push_stack_frame( &mut self, flattened_adoptees: RenderNodePtrList<R>, properties: Rc<RefCell<PropertiesCoproduct>>, timeline: Option<Rc<RefCell<Timeline>>> )

Add a new frame to the stack, passing a list of adoptees that may be handled by Slot and a scope that includes the PropertiesCoproduct of the associated Component

source

pub fn push_clipping_stack_id(&mut self, id_chain: Vec<u32>)

source

pub fn pop_clipping_stack_id(&mut self)

source

pub fn get_current_clipping_ids(&self) -> Vec<Vec<u32>>

source

pub fn push_scroller_stack_id(&mut self, id_chain: Vec<u32>)

source

pub fn pop_scroller_stack_id(&mut self)

source

pub fn get_current_scroller_ids(&self) -> Vec<Vec<u32>>

source

pub fn process__should_flatten__adoptees_recursive( adoptee: &RenderNodePtr<R>, rtc: &mut RenderTreeContext<'_, R> ) -> Vec<RenderNodePtr<R>>

Handles special-cases like for/Repeat, where properties for the control flow primitive need to be computed out-of-lifecycle, and where nested child elements need to be treated as top-level elements. For example, for <Stacker><Ellipse />for i in (0..3){ <Rectangle /> }</Stacker>, without this special handling Stacker will receive only two adoptees: the Ellipse and the Repeat node created by for. In other words fors children need to be treated as <Stacker>s children, and this processing allows that to happpen. Note that this must be recursive to handle nested cases of flattening, for example nested for loops

Auto Trait Implementations§

§

impl<R> !RefUnwindSafe for Runtime<R>

§

impl<R> !Send for Runtime<R>

§

impl<R> !Sync for Runtime<R>

§

impl<R> Unpin for Runtime<R>

§

impl<R> !UnwindSafe for Runtime<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, 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.