Struct i_slint_compiler::object_tree::Component
source · [−]pub struct Component {
pub id: String,
pub root_element: ElementRc,
pub parent_element: Weak<RefCell<Element>>,
pub optimized_elements: RefCell<Vec<ElementRc>>,
pub embedded_file_resources: RefCell<HashMap<String, EmbeddedResources>>,
pub root_constraints: RefCell<LayoutConstraints>,
pub child_insertion_point: RefCell<Option<(ElementRc, ChildrenPlaceholder)>>,
pub setup_code: RefCell<Vec<Expression>>,
pub used_types: RefCell<UsedSubTypes>,
pub popup_windows: RefCell<Vec<PopupWindow>>,
pub exported_global_names: RefCell<Vec<ExportedName>>,
pub is_root_component: Cell<bool>,
}
Expand description
A component is a type in the language which can be instantiated, Or is materialized for repeated expression.
Fields
id: String
root_element: ElementRc
parent_element: Weak<RefCell<Element>>
The parent element within the parent component if this component represents a repeated element
optimized_elements: RefCell<Vec<ElementRc>>
List of elements that are not attached to the root anymore because they have been optimized away, but their properties may still be in use
embedded_file_resources: RefCell<HashMap<String, EmbeddedResources>>
Map of resources that should be embedded in the generated code, indexed by their absolute path on disk on the build system
root_constraints: RefCell<LayoutConstraints>
The layout constraints of the root item
child_insertion_point: RefCell<Option<(ElementRc, ChildrenPlaceholder)>>
When creating this component and inserting “children”, append them to the children of the element pointer to by this field.
setup_code: RefCell<Vec<Expression>>
Code to be inserted into the constructor
used_types: RefCell<UsedSubTypes>
The list of used extra types used (recursively) by this root component. (This only make sense on the root component)
popup_windows: RefCell<Vec<PopupWindow>>
exported_global_names: RefCell<Vec<ExportedName>>
The names under which this component should be accessible if it is a global singleton and exported.
is_root_component: Cell<bool>
This is the main entry point for the code generators. Such a component should have the full API, etc.
Implementations
sourceimpl Component
impl Component
pub fn from_node(
node: Component,
diag: &mut BuildDiagnostics,
tr: &TypeRegister
) -> Rc<Self>
sourcepub fn is_global(&self) -> bool
pub fn is_global(&self) -> bool
This component is a global component introduced with the “global” keyword
sourcepub fn requires_code_generation(&self) -> bool
pub fn requires_code_generation(&self) -> bool
Returns true if use/instantiation of this component requires generating code in Rust/C++/etc..
pub fn visible_in_public_api(&self) -> bool
sourcepub fn global_aliases(&self) -> Vec<String>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn global_aliases(&self) -> Vec<String>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns the names of aliases to global singletons, exactly as specified in the .slint markup (not normalized).
pub fn is_sub_component(&self) -> bool
pub fn repeater_count(&self) -> u32
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Component
impl !Send for Component
impl !Sync for Component
impl Unpin for Component
impl !UnwindSafe for Component
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<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for P where
R: Read + ReadEndian<P>,
P: Default,
sourcefn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian()
.
sourcefn read_from_big_endian(read: &mut R) -> Result<Self, Error>
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian()
.
sourcefn read_from_native_endian(read: &mut R) -> Result<Self, Error>
fn read_from_native_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian()
.