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>>>,
/* 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>>>
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 Component
s, 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 Freeze for BaseInstance
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.