Struct i_slint_core::component_factory::ComponentFactory
source · pub struct ComponentFactory(/* private fields */);Expand description
A ComponentFactory can be used to create new Components at runtime,
taking a factory function returning a ComponentHandle.
The FactoryContext is passed to that factory function.
A ComponentFactory implements the component-factory type for
properties in the Slint language.
The component-factory is used by an ComponentContainer element in Slint
files to embed UI elements based on the produced component within the
ComponentContainer element.
Implementations§
source§impl ComponentFactory
impl ComponentFactory
sourcepub fn new<T: ComponentHandle + 'static>(
factory: impl Fn(FactoryContext) -> Option<T> + 'static
) -> Selfwhere
T::Inner: HasStaticVTable<ItemTreeVTable> + 'static,
pub fn new<T: ComponentHandle + 'static>( factory: impl Fn(FactoryContext) -> Option<T> + 'static ) -> Selfwhere T::Inner: HasStaticVTable<ItemTreeVTable> + 'static,
Create a new ComponentFactory
Trait Implementations§
source§impl Clone for ComponentFactory
impl Clone for ComponentFactory
source§fn clone(&self) -> ComponentFactory
fn clone(&self) -> ComponentFactory
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for ComponentFactory
impl Debug for ComponentFactory
source§impl Default for ComponentFactory
impl Default for ComponentFactory
source§fn default() -> ComponentFactory
fn default() -> ComponentFactory
Returns the “default value” for a type. Read more
source§impl PartialEq for ComponentFactory
impl PartialEq for ComponentFactory
source§fn eq(&self, other: &ComponentFactory) -> bool
fn eq(&self, other: &ComponentFactory) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for ComponentFactory
Auto Trait Implementations§
impl !RefUnwindSafe for ComponentFactory
impl !Send for ComponentFactory
impl !Sync for ComponentFactory
impl Unpin for ComponentFactory
impl !UnwindSafe for ComponentFactory
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