Skip to main content

AssemblyModel

Struct AssemblyModel 

Source
pub struct AssemblyModel {
Show 17 fields pub name: String, pub crate_name: String, pub xmlns_definitions: Vec<XmlnsDefinitionModel>, pub xmlns_prefixes: Vec<XmlnsPrefixModel>, pub metadata: Vec<(String, String)>, pub namespaces: Vec<(String, String)>, pub types: Vec<TypeModel>, pub exports: Vec<ExportModel>, pub aliases: Vec<AliasModel>, pub handles: Vec<HandleModel>, pub casts: Vec<CastModel>, pub value_types: Vec<ValueTypeModel>, pub unread_value_types: Vec<(String, i64)>, pub macros: Vec<MacroModel>, pub functions: Vec<FunctionsModel>, pub documents: Vec<DocumentModel>, pub dependencies: Vec<String>,
}
Expand description

What a crate states about itself for markup (AssemblyModel).

Fields§

§name: String

The assembly name.

§crate_name: String

The name of the crate, as Rust paths spell it.

§xmlns_definitions: Vec<XmlnsDefinitionModel>§xmlns_prefixes: Vec<XmlnsPrefixModel>§metadata: Vec<(String, String)>

The metadata of the assembly (FerroXamlCreateSourceInfo), name and value.

§namespaces: Vec<(String, String)>

The namespace table: a module path and the dotted namespace of the types declared below it. A type belongs to the namespace of the longest module path that is a prefix of the path of its module.

§types: Vec<TypeModel>§exports: Vec<ExportModel>

The export table of the crate: every path another crate can name a type of the crate by, with the path of the module that declares it (9.5.2, step 1). What a glob import of a module of the crate brings into another crate, and what makes a path into the crate canonical, is read from it.

§aliases: Vec<AliasModel>

The type aliases of the crate whose type the scanner resolved.

§handles: Vec<HandleModel>

The handles the crate registers for types with markup metadata, of this crate or of the crates it is built on.

§casts: Vec<CastModel>

The casts the crate registers between Rust types, in the order of the scan.

§value_types: Vec<ValueTypeModel>

The other registrations with the untyped value conversions the functions of the crate make with their types stated.

§unread_value_types: Vec<(String, i64)>

The registrations the text of the crate has and the model does not: for each registration function (VALUE_REGISTRATIONS) with such calls, their number (a call that leaves a type to inference, a call in the body of a macro, in a macro invocation or in test code). A crate with such calls registers more than its model states, so nothing follows from a registration that is not in the model.

§macros: Vec<MacroModel>

The macros the crate exports that declare through a declaration macro.

§functions: Vec<FunctionsModel>

The public functions of the inherent impl blocks of the types of the crate that another crate can name, by type, in the order of the scan.

§documents: Vec<DocumentModel>

The compiled documents, in the order of the compilation.

§dependencies: Vec<String>

The .xamlmeta files of the crates this crate is built on, relative to the directory of this file or absolute.

Implementations§

Source§

impl AssemblyModel

Source

pub fn new(name: &str, crate_name: &str) -> AssemblyModel

A model without types and documents.

Source

pub fn from_metadata(metadata: XamlMetadata) -> AssemblyModel

The model of a file of format 1: the documents of a crate, no types.

Source

pub fn metadata(&self) -> XamlMetadata

The part of the model a file of format 1 holds: what the compiler reads today.

Source

pub fn namespace_of_module(&self, module: &str) -> &str

The namespace the table gives the module module; empty when it has none.

Source

pub fn find_type(&self, full_name: &str) -> Option<&TypeModel>

The type with the namespace-qualified name full_name.

Source

pub fn find_rust_type(&self, rust_path: &str) -> Option<&TypeModel>

The type with the Rust type text rust_path (its path, for a type the crate declares).

Source

pub fn visit_types_mut(&mut self, visit: &mut dyn FnMut(&mut RustType))

Calls visit with every type text of the model that is not of one of its types: the types of its aliases, its registered handles and its registered casts.

Source

pub fn to_json(&self) -> String

The model as the text of a .xamlmeta file of format 2.

Source

pub fn parse(text: &str) -> Result<AssemblyModel, String>

Reads the model from the text of a .xamlmeta file of format 1 or 2.

Trait Implementations§

Source§

impl Clone for AssemblyModel

Source§

fn clone(&self) -> AssemblyModel

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AssemblyModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for AssemblyModel

Source§

impl PartialEq for AssemblyModel

Source§

fn eq(&self, other: &AssemblyModel) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AssemblyModel

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> AnyValue for T
where T: PartialEq + 'static,

Source§

fn any_value_as_any(&self) -> &(dyn Any + 'static)

Source§

fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool

Source§

fn any_value_type_name(&self) -> &'static str

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> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> PropertyValue for T
where T: Clone + PartialEq + 'static,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.