FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    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.

    Source

    as_type_system

    fn as_type_system(self: &Self) -> Rc<dyn IXamlTypeSystem>
    

    This type system as a type system handle.

    Source

    models

    fn models(self: &Self) -> &ModelSet
    

    The models the type system is over.

    Source

    get

    fn get(self: &Self, full_name: &str) -> Rc<dyn IXamlType>
    

    The type named full_name, or the unknown pseudo type.

    Source

    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).

    Source

    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).

    Source

    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.

    Source

    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.

    Source

    nullable_of

    fn nullable_of(self: &Self, type_: &Rc<dyn IXamlType>) -> Option<Rc<dyn IXamlType>>
    

    System.Nullable<T> of a value type.

    Source

    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.

    Source

    project_attribute

    fn project_attribute(self: &Self, attribute: &AttributeModel) -> Rc<dyn IXamlCustomAttribute>
    

    Projects an attribute of the model.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • IXamlTypeSystem

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.