pub struct ModelSet { /* private fields */ }Expand description
The models of a set of crates, with what is looked up across them.
Implementations§
Source§impl ModelSet
impl ModelSet
Sourcepub fn new(models: Vec<AssemblyModel>) -> ModelSet
pub fn new(models: Vec<AssemblyModel>) -> ModelSet
The set of models. Of two types with one Rust type the first is the type.
pub fn models(&self) -> &[AssemblyModel]
pub fn is_empty(&self) -> bool
Sourcepub fn type_at(&self, position: (usize, usize)) -> &TypeModel
pub fn type_at(&self, position: (usize, usize)) -> &TypeModel
The type at the position (model, type) of the set.
Sourcepub fn canonical_path(&self, path: &str) -> String
pub fn canonical_path(&self, path: &str) -> String
The path path (::ferroui_base::Border::child_property) with its longest prefix
that a model exports replaced by the path of the declaring module; path itself
when no model exports a prefix of it.
Sourcepub fn canonical(&self, text: &str) -> String
pub fn canonical(&self, text: &str) -> String
The normalised type text text with every absolute path made canonical
(canonical_path): the text the model of the declaring
crate has for the same type.
Sourcepub fn expanded(&self, text: &str) -> String
pub fn expanded(&self, text: &str) -> String
The normalised type text text as the one text of its Rust type: canonical
(canonical), with every type alias of the models replaced by
the type it stands for (PageList by FerroList<Ref<Page>>). Two spellings of one
type have one expanded text, which is what a handle is looked up by.
Sourcepub fn position_of_rust_type(&self, rust_path: &str) -> Option<(usize, usize)>
pub fn position_of_rust_type(&self, rust_path: &str) -> Option<(usize, usize)>
The type with the Rust type text rust_path, in any spelling of its paths: its
position in the set.
Sourcepub fn find_rust_type(
&self,
rust_path: &str,
) -> Option<(&AssemblyModel, &TypeModel)>
pub fn find_rust_type( &self, rust_path: &str, ) -> Option<(&AssemblyModel, &TypeModel)>
The type with the Rust type text rust_path (its path, for a type a crate
declares), in whichever model has it, with that model.
Sourcepub fn find_type(&self, full_name: &str) -> Option<(&AssemblyModel, &TypeModel)>
pub fn find_type(&self, full_name: &str) -> Option<(&AssemblyModel, &TypeModel)>
The first type with the namespace-qualified name full_name, with its model.
Sourcepub fn find_accessor(
&self,
path: &str,
) -> Option<(&TypeModel, &RegisteredModel)>
pub fn find_accessor( &self, path: &str, ) -> Option<(&TypeModel, &RegisteredModel)>
The accessor of a registered property with the absolute path path
(::ferroui_base::Decorator::child_property, in any spelling), with its type.
The path names the type the accessor is a function of, which is the type the
property is listed under unless the model states another
(RegisteredModel::function_of): ThemeVariant::actual_theme_variant_property is
found with StyledElement, the type that has the property.
Sourcepub fn accessor_type_path<'a>(
&'a self,
listed: &'a TypeModel,
registered: &'a RegisteredModel,
) -> &'a str
pub fn accessor_type_path<'a>( &'a self, listed: &'a TypeModel, registered: &'a RegisteredModel, ) -> &'a str
The path generated code names the type by whose function the accessor registered
of the type listed is: the type itself, or the one the model states.
Sourcepub fn declaration_of<'a>(
&'a self,
registered: &'a RegisteredModel,
) -> Option<&'a RegisteredModel>
pub fn declaration_of<'a>( &'a self, registered: &'a RegisteredModel, ) -> Option<&'a RegisteredModel>
The declaration of the property registered is an accessor of: itself when it
declares the property, else the accessor its body calls, followed to the
declaration through the models. Nothing when an accessor on the way is in no model.
Sourcepub fn name_of<'a>(&'a self, registered: &'a RegisteredModel) -> Option<&'a str>
pub fn name_of<'a>(&'a self, registered: &'a RegisteredModel) -> Option<&'a str>
The name of the property registered is an accessor of: its own, else the one of
its declaration.
Sourcepub fn exported_names<'a>(
&'a self,
module: &'a str,
) -> impl Iterator<Item = (&'a str, &'a str)> + 'a
pub fn exported_names<'a>( &'a self, module: &'a str, ) -> impl Iterator<Item = (&'a str, &'a str)> + 'a
The names the module module of a crate of the set gives another crate
(::ferroui_base, ::ferroui_base::media), each with the path of the declaring
module: what a glob import of the module brings.
Sourcepub fn read(
paths: &[PathBuf],
) -> Result<(Vec<AssemblyModel>, Vec<PathBuf>), String>
pub fn read( paths: &[PathBuf], ) -> Result<(Vec<AssemblyModel>, Vec<PathBuf>), String>
The models of the .xamlmeta files paths and, transitively, of the files they
name (relative to the naming file; DEP_* metadata exists for direct dependencies
only), each assembly once, in the order of paths, with every file that was read.
A file of format 1 is a model without types.
Auto Trait Implementations§
impl Freeze for ModelSet
impl RefUnwindSafe for ModelSet
impl Send for ModelSet
impl Sync for ModelSet
impl Unpin for ModelSet
impl UnsafeUnpin for ModelSet
impl UnwindSafe for ModelSet
Blanket Implementations§
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