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) -> ComponentInstance
pub fn create(&self) -> ComponentInstance
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 more