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>
impl<R: 'static + RenderContext> Runtime<R>
pub fn new() -> Self
pub fn get_list_of_repeat_indicies_from_stack(&self) -> Vec<u32>
pub fn take_native_message_queue(&mut self) -> VecDeque<NativeMessage>
pub fn enqueue_native_message(&mut self, msg: NativeMessage)
sourcepub fn peek_stack_frame(&mut self) -> Option<Rc<RefCell<StackFrame<R>>>>
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
sourcepub fn pop_stack_frame(&mut self)
pub fn pop_stack_frame(&mut self)
Remove the top element from the stack. Currently does nothing with the value of the popped StackFrame.
sourcepub fn push_stack_frame(
&mut self,
flattened_adoptees: RenderNodePtrList<R>,
properties: Rc<RefCell<PropertiesCoproduct>>,
timeline: Option<Rc<RefCell<Timeline>>>
)
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
pub fn push_clipping_stack_id(&mut self, id_chain: Vec<u32>)
pub fn pop_clipping_stack_id(&mut self)
pub fn get_current_clipping_ids(&self) -> Vec<Vec<u32>>
pub fn push_scroller_stack_id(&mut self, id_chain: Vec<u32>)
pub fn pop_scroller_stack_id(&mut self)
pub fn get_current_scroller_ids(&self) -> Vec<Vec<u32>>
sourcepub fn process__should_flatten__adoptees_recursive(
adoptee: &RenderNodePtr<R>,
rtc: &mut RenderTreeContext<'_, R>
) -> Vec<RenderNodePtr<R>>
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