Skip to main content

ModelSet

Struct ModelSet 

Source
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

Source

pub fn new(models: Vec<AssemblyModel>) -> ModelSet

The set of models. Of two types with one Rust type the first is the type.

Source

pub fn models(&self) -> &[AssemblyModel]

Source

pub fn is_empty(&self) -> bool

Source

pub fn type_at(&self, position: (usize, usize)) -> &TypeModel

The type at the position (model, type) of the set.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

The first type with the namespace-qualified name full_name, with its model.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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§

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