[][src]Struct sixtyfps_compilerlib::object_tree::Component

pub struct Component {
    pub id: String,
    pub root_element: ElementRc,
    pub parent_element: Weak<RefCell<Element>>,
    pub optimized_elements: RefCell<Vec<ElementRc>>,
    pub referenced_file_resources: RefCell<HashMap<String, usize>>,
    pub embed_file_resources: Cell<bool>,
    pub layouts: RefCell<LayoutVec>,
    pub child_insertion_point: RefCell<Option<ElementRc>>,
    pub setup_code: RefCell<Vec<Expression>>,
}

A component is a type in the language which can be instantiated, Or is materialized for repeated expression.

Fields

id: Stringroot_element: ElementRcparent_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

referenced_file_resources: RefCell<HashMap<String, usize>>

Map of resources to referenced in the sources, indexed by their absolute path on disk on the build system and valued by a unique integer id, that can be used by the generator for symbol generation.

embed_file_resources: Cell<bool>

Copied from the compiler configuration, generators can use this to detect if file resources should be embedded.

layouts: RefCell<LayoutVec>

All layouts in this component

child_insertion_point: RefCell<Option<ElementRc>>

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

Implementations

impl Component[src]

pub fn from_node(
    node: Component,
    diag: &mut FileDiagnostics,
    tr: &TypeRegister
) -> Rc<Self>
[src]

Trait Implementations

impl Debug for Component[src]

impl Default for Component[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.