Struct Document

Source
pub struct Document {
    pub node: Option<Document>,
    pub inner_components: Vec<Rc<Component>>,
    pub inner_types: Vec<Type>,
    pub local_registry: TypeRegister,
    pub custom_fonts: Vec<(SmolStr, SyntaxToken)>,
    pub exports: Exports,
    pub imports: Vec<ImportedTypes>,
    pub embedded_file_resources: RefCell<BTreeMap<SmolStr, EmbeddedResources>>,
    pub used_types: RefCell<UsedSubTypes>,
    pub popup_menu_impl: Option<Rc<Component>>,
}
Expand description

The full document (a complete file)

Fields§

§node: Option<Document>§inner_components: Vec<Rc<Component>>§inner_types: Vec<Type>§local_registry: TypeRegister§custom_fonts: Vec<(SmolStr, SyntaxToken)>

A list of paths to .ttf/.ttc files that are supposed to be registered on startup for custom font use.

§exports: Exports§imports: Vec<ImportedTypes>§embedded_file_resources: RefCell<BTreeMap<SmolStr, EmbeddedResources>>

Map of resources that should be embedded in the generated code, indexed by their absolute path on disk on the build system

§used_types: RefCell<UsedSubTypes>

The list of used extra types used recursively.

§popup_menu_impl: Option<Rc<Component>>

The popup_menu_impl

Implementations§

Source§

impl Document

Source

pub fn from_node( node: Document, imports: Vec<ImportedTypes>, reexports: Exports, diag: &mut BuildDiagnostics, parent_registry: &Rc<RefCell<TypeRegister>>, ) -> Self

Source

pub fn exported_roots( &self, ) -> impl DoubleEndedIterator<Item = Rc<Component>> + '_

Source

pub fn last_exported_component(&self) -> Option<Rc<Component>>

This is the component that is going to be instantiated by the interpreter

Source

pub fn visit_all_used_components(&self, v: impl FnMut(&Rc<Component>))

visit all root and used component (including globals)

Trait Implementations§

Source§

impl Default for Document

Source§

fn default() -> Document

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,