pub struct TypeModel {Show 35 fields
pub namespace: String,
pub explicit_namespace: Option<String>,
pub name: String,
pub kind: TypeKind,
pub object_model: bool,
pub class_markup: bool,
pub unregistered: bool,
pub rust_path: RustType,
pub public_path: Option<String>,
pub stated_path: Option<String>,
pub module: String,
pub cfg: Vec<String>,
pub handles: Vec<RustType>,
pub this: Option<RustType>,
pub base: Option<RustType>,
pub interfaces: Vec<RustType>,
pub generic: Option<GenericModel>,
pub type_info: Option<RustType>,
pub default_constructor: Option<CallableModel>,
pub content_property: Option<String>,
pub parse: Option<CallableModel>,
pub parse_call: Option<CallForm>,
pub constructors: Vec<MemberModel>,
pub properties: Vec<PropertyModel>,
pub static_properties: Vec<PropertyModel>,
pub indexers: Vec<PropertyModel>,
pub registered: Vec<RegisteredModel>,
pub methods: Vec<MemberModel>,
pub fields: Vec<MemberModel>,
pub events: Vec<MemberModel>,
pub enum_members: Vec<EnumMemberModel>,
pub is_flags: bool,
pub attributes: Vec<AttributeModel>,
pub property_attributes: Vec<(String, Vec<AttributeModel>)>,
pub notify_property_changed: Option<RustType>,
}Expand description
A type of a crate (TypeModel).
Fields§
§namespace: StringThe dotted namespace: the explicit one, else the one the namespace table of the crate gives the declaring module; empty when the table has none.
explicit_namespace: Option<String>namespace: ".." of the markup metadata.
name: StringThe markup name.
kind: TypeKind§object_model: boolThe type is a type of the object model: a class (ferro_class!) or the static
owner type of attached properties (ferro_static_type!), with a runtime type of
its own. Its handles (Ref<X>, Option<Ref<X>> for a class) are implied.
class_markup: boolThe class states markup metadata of its own (markup: { .. } of a
ferro_class_info!): its runtime type has metadata, whatever the part lists.
unregistered: boolThe crate has a list of the classes it registers (const TYPES: &[&TypeInfo], which
its register_types() hands to TypeInfo::register_all) and the type is not in
it: the type is not known by its name or by its handle until an instance of it is
created. Never set for a crate without such a list, and never for a type that is
not of the object model.
rust_path: RustTypeThe Rust type: for a type the crate declares, the absolute path of the declaring module and the name; for a type the metadata is declared for, the type as the declaration writes it, normalised.
public_path: Option<String>The shortest path another crate names the type by, when the scanner found one
(::ferroui_controls::Border).
stated_path: Option<String>The path the crate states for the type where no public path is found: the one of an
instantiation of a generic type (generics: of ferro_rust_paths!), written with
the name the crate has for the generic type and the public paths of its arguments
(::ferroui_controls::FerroListOf<::ferroui_base::Ref<::ferroui_controls::RowDefinition>>).
module: StringThe module of the declaration that gives the type its namespace
(ferroui_controls::border).
cfg: Vec<String>The cfg conditions the declaration is under, as written, outermost first.
handles: Vec<RustType>The Rust types that hold a value of the type, the untyped form first. For a class
of the object model Ref<X> and Option<Ref<X>> are implied and not listed.
this: Option<RustType>The type instance members receive (this:).
base: Option<RustType>The base class of a class of the object model, or the base type by handle (base:).
interfaces: Vec<RustType>The contracts, by handle (interfaces:).
generic: Option<GenericModel>§type_info: Option<RustType>type_info: X: the runtime type the metadata of a static type belongs to.
default_constructor: Option<CallableModel>new: of a class: the constructor without parameters.
content_property: Option<String>§parse: Option<CallableModel>parse: (has_parse of the design is parse.is_some()); its typed function is
__markup_parse.
parse_call: Option<CallForm>The call form of parse: (9.5.3), once it is chosen.
constructors: Vec<MemberModel>§properties: Vec<PropertyModel>§static_properties: Vec<PropertyModel>§indexers: Vec<PropertyModel>§registered: Vec<RegisteredModel>§methods: Vec<MemberModel>§fields: Vec<MemberModel>§events: Vec<MemberModel>§enum_members: Vec<EnumMemberModel>§is_flags: bool§attributes: Vec<AttributeModel>§property_attributes: Vec<(String, Vec<AttributeModel>)>The attributes of registered properties, by the name of the property.
notify_property_changed: Option<RustType>notify_property_changed: T.
Implementations§
Source§impl TypeModel
impl TypeModel
Sourcepub fn new(
name: &str,
kind: TypeKind,
rust_path: RustType,
module: &str,
) -> TypeModel
pub fn new( name: &str, kind: TypeKind, rust_path: RustType, module: &str, ) -> TypeModel
A type with nothing but its identity.
Sourcepub fn registered(&self, name: &str) -> Option<&RegisteredModel>
pub fn registered(&self, name: &str) -> Option<&RegisteredModel>
The registered property of the type with the name name.
Sourcepub fn named_path(&self) -> &str
pub fn named_path(&self) -> &str
The path generated code and other crates name the type by: the public path when the scanner found one, else the Rust type.
Sourcepub fn visit_types_mut(&mut self, visit: &mut dyn FnMut(&mut RustType))
pub fn visit_types_mut(&mut self, visit: &mut dyn FnMut(&mut RustType))
Calls visit with every type text of the type: its own, its handles, base and
interfaces, and the types of its members and of the arguments of its attributes.
Sourcepub fn visit_callables_mut(&mut self, visit: &mut dyn FnMut(&mut CallableModel))
pub fn visit_callables_mut(&mut self, visit: &mut dyn FnMut(&mut CallableModel))
Calls visit with every callable of the type that is a path: its constructors,
parse:, the accessors of its properties, its members, and the sources of its
registered properties.
Trait Implementations§
impl Eq for TypeModel
impl StructuralPartialEq for TypeModel
Auto Trait Implementations§
impl Freeze for TypeModel
impl RefUnwindSafe for TypeModel
impl Send for TypeModel
impl Sync for TypeModel
impl Unpin for TypeModel
impl UnsafeUnpin for TypeModel
impl UnwindSafe for TypeModel
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more