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
sourceimpl 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
sourceimpl Clone for ComponentDefinition
impl Clone for ComponentDefinition
sourcefn clone(&self) -> ComponentDefinition
fn clone(&self) -> ComponentDefinition
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for ComponentDefinition
impl !Send for ComponentDefinition
impl !Sync for ComponentDefinition
impl Unpin for ComponentDefinition
impl !UnwindSafe for ComponentDefinition
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more