ModelTypeSystem
struct · ferroui-build · v0.5.0
struct ModelTypeSystem
The build-time type system.
The shells of the types of the models are created with the type system, in the order of the models; a type costs its name until one of its members is asked for.
Members
newas_type_systemmodelsgettype_of_modeltypes_of_modelresolveis_castnullable_ofattribute_typeproject_attribute
new
fn new(models: Vec<AssemblyModel>) -> Rc<Self>
The type system over models: the model of a crate and the models of the crates
it is built on. Of two types with one full name the first is the type of the name.
as_type_system
fn as_type_system(self: &Self) -> Rc<dyn IXamlTypeSystem>
This type system as a type system handle.
models
fn models(self: &Self) -> &ModelSet
The models the type system is over.
get
fn get(self: &Self, full_name: &str) -> Rc<dyn IXamlType>
The type named full_name, or the unknown pseudo type.
type_of_model
fn type_of_model(self: &Self, position: Position) -> Rc<dyn IXamlType>
The type the declaration at position of the models is (or is part of).
types_of_model
fn types_of_model(self: &Self, model: usize) -> Vec<(&TypeModel, Rc<ModelType>)>
Every declaration of the model at model, with the type it is (or is part of).
resolve
fn resolve(self: &Self, rust_type: &str) -> Rc<dyn IXamlType>
The type that values of the Rust type rust_type (normalised type text, in any
spelling of its paths and through any type alias of the models) are values of
(docs/porting/xaml.md, 9.5.2): a runtime library type, a class (for its handle and
its optional handle), a type with markup metadata (the optional form of a value
type is System.Nullable<T>), or else an opaque type that carries the text.
is_cast
fn is_cast(self: &Self, from: &str, to: &str) -> bool
Whether a value of the Rust type from is a value of the Rust type to: the two
are one type, or a crate registers the cast between them.
nullable_of
fn nullable_of(self: &Self, type_: &Rc<dyn IXamlType>) -> Option<Rc<dyn IXamlType>>
System.Nullable<T> of a value type.
attribute_type
fn attribute_type(self: &Self, name: &str) -> Rc<dyn IXamlType>
The type of the attribute a metadata attribute named name is projected to;
defined by the type system if no such type is declared.
project_attribute
fn project_attribute(self: &Self, attribute: &AttributeModel) -> Rc<dyn IXamlCustomAttribute>
Projects an attribute of the model.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEitherIXamlTypeSystem
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.