Struct slint_interpreter::ComponentDefinition
source ยท pub struct ComponentDefinition { /* private fields */ }
Expand description
ComponentDefinition is a representation of a compiled component from .slint markup.
It can be constructed from a .slint file using the ComponentCompiler::build_from_path
or ComponentCompiler::build_from_source
functions.
And then it can be instantiated with the Self::create
function.
The ComponentDefinition acts as a factory to create new instances. When youโve finished creating the instances it is safe to drop the ComponentDefinition.
Implementationsยง
sourceยงimpl ComponentDefinition
impl ComponentDefinition
sourcepub fn create(&self) -> Result<ComponentInstance, PlatformError>
pub fn create(&self) -> Result<ComponentInstance, PlatformError>
Creates a new instance of the component and returns a shared handle to it.
sourcepub fn properties(&self) -> impl Iterator<Item = (String, ValueType)> + '_
pub fn properties(&self) -> impl Iterator<Item = (String, ValueType)> + '_
List of publicly declared properties.
sourcepub fn callbacks(&self) -> impl Iterator<Item = String> + '_
pub fn callbacks(&self) -> impl Iterator<Item = String> + '_
Returns the names of all publicly declared callbacks.
sourcepub fn globals(&self) -> impl Iterator<Item = String> + '_
pub fn globals(&self) -> impl Iterator<Item = String> + '_
Returns the names of all exported global singletons
Note: Only globals that are exported or re-exported from the main .slint file will be exposed in the API
sourcepub fn global_properties(
&self,
global_name: &str
) -> Option<impl Iterator<Item = (String, ValueType)> + '_>
pub fn global_properties( &self, global_name: &str ) -> Option<impl Iterator<Item = (String, ValueType)> + '_>
List of publicly declared properties in the exported global singleton specified by its name.
Trait Implementationsยง
sourceยงimpl Clone for ComponentDefinition
impl Clone for ComponentDefinition
sourceยงfn clone(&self) -> ComponentDefinition
fn clone(&self) -> ComponentDefinition
1.0.0 ยท sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementationsยง
impl !RefUnwindSafe for ComponentDefinition
impl !Send for ComponentDefinition
impl !Sync for ComponentDefinition
impl Unpin for ComponentDefinition
impl !UnwindSafe for ComponentDefinition
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
ยงimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
ยงfn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.ยงfn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.ยงfn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
โs vtable from &Trait
โs.ยงfn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
โs vtable from &mut Trait
โs.