Struct pax_runtime::rendering::BaseInstance
source · pub struct BaseInstance {
pub handler_registry: Option<Rc<RefCell<HandlerRegistry>>>,
pub instance_prototypical_properties_factory: Box<dyn Fn() -> Rc<RefCell<dyn Any>>>,
pub instance_prototypical_common_properties_factory: Box<dyn Fn() -> Rc<RefCell<CommonProperties>>>,
pub template_node_identifier: Option<UniqueTemplateNodeIdentifier>,
/* private fields */
}Fields§
§handler_registry: Option<Rc<RefCell<HandlerRegistry>>>§instance_prototypical_properties_factory: Box<dyn Fn() -> Rc<RefCell<dyn Any>>>§instance_prototypical_common_properties_factory: Box<dyn Fn() -> Rc<RefCell<CommonProperties>>>§template_node_identifier: Option<UniqueTemplateNodeIdentifier>Implementations§
source§impl BaseInstance
impl BaseInstance
pub fn new(args: InstantiationArgs, flags: InstanceFlags) -> Self
sourcepub fn get_handler_registry(&self) -> Option<Rc<RefCell<HandlerRegistry>>>
pub fn get_handler_registry(&self) -> Option<Rc<RefCell<HandlerRegistry>>>
Returns a handle to a node-managed HandlerRegistry, a mapping between event types and handlers.
Each node that can handle events is responsible for implementing this; Component instances generate
the necessary code to wire up userland events like <SomeNode @click=self.handler>. Primitives must handle
this explicitly, see e.g. [pax_std_primitives::RectangleInstance#get_handler_registry].
sourcepub fn get_instance_children(&self) -> &InstanceNodePtrList
pub fn get_instance_children(&self) -> &InstanceNodePtrList
Return the list of instance nodes that are children of this one. Intuitively, this will return
instance nodes mapping exactly to the template node definitions.
For Components, get_instance_children returns the root(s) of its template, not its slot_children.
(see [get_slot_children] for the way to retrieve the latter.)
pub fn flags(&self) -> &InstanceFlags
Auto Trait Implementations§
impl !RefUnwindSafe for BaseInstance
impl !Send for BaseInstance
impl !Sync for BaseInstance
impl Unpin for BaseInstance
impl !UnwindSafe for BaseInstance
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, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.