GeneratorOptions
struct · ferroui-static-view-locator-build · v0.5.0
struct GeneratorOptions
The options of the generator (GeneratorOptions).
Members
namespace_prefixesinclude_internal_view_modelsinclude_referenced_cratesadditional_view_base_typesnamespace_replacement_rulestype_name_replacement_rulesstrip_generic_arity_from_view_nameinterface_prefixes_to_stripeffective_namespace_ruleseffective_type_name_rulesset
namespace_prefixes
namespace_prefixes: Vec<String>
The module paths view models are taken from (StaticViewLocatorViewModelNamespacePrefixes):
a view model is taken when its module is one of them or below one; empty, from every
module. A path is written from the crate (crate::view_models, or the name of the crate).
include_internal_view_models
include_internal_view_models: bool
StaticViewLocatorIncludeInternalViewModels. Kept for the options of the reference and
without an effect: Rust has no InternalsVisibleTo, and a view model of another crate is
taken only when it is public.
include_referenced_crates
include_referenced_crates: bool
Whether the view models of the crates the crate depends on are taken
(StaticViewLocatorIncludeReferencedAssemblies): the types of their models (the
.xamlmeta of the crates that export one) whose name ends with ViewModel.
additional_view_base_types
additional_view_base_types: Vec<String>
More view base types (StaticViewLocatorAdditionalViewBaseTypes), as Rust paths from the
crate (crate::controls::ToolWindowBase) or of a dependency (my_controls::Panel).
namespace_replacement_rules
namespace_replacement_rules: Vec<ReplacementRule>
Applied in order to the module path of a view model to find the module of its view
(StaticViewLocatorNamespaceReplacementRules), then DEFAULT_NAMESPACE_RULES.
type_name_replacement_rules
type_name_replacement_rules: Vec<ReplacementRule>
Applied in order to the name of a view model to find the name of its view
(StaticViewLocatorTypeNameReplacementRules), then DEFAULT_TYPE_NAME_RULES.
strip_generic_arity_from_view_name
strip_generic_arity_from_view_name: bool
Whether the view of a generic view model is found by the name alone, whatever the generic
parameters of the view (StaticViewLocatorStripGenericArityFromViewName, default true).
interface_prefixes_to_strip
interface_prefixes_to_strip: Vec<String>
Removed from the name of a trait view model before its view is looked up
(StaticViewLocatorInterfacePrefixesToStrip, default I).
effective_namespace_rules
fn effective_namespace_rules(self: &Self) -> Vec<ReplacementRule>
The namespace rules applied in order: the configured ones, then the defaults
(GetReplacementRules).
effective_type_name_rules
fn effective_type_name_rules(self: &Self) -> Vec<ReplacementRule>
The type name rules applied in order: the configured ones, then the default.
set
fn set(self: &mut Self, name: &str, value: &str) -> Result<(), String>
Sets the option name from its text, as the reference reads an MSBuild property: the
names are the ones of the setters of StaticViewLocatorBuild
(view_model_namespace_prefixes, include_internal_view_models,
include_referenced_crates, additional_view_base_types, namespace_replacement_rules,
type_name_replacement_rules, strip_generic_arity_from_view_name,
interface_prefixes_to_strip), and the properties of the reference
(StaticViewLocatorViewModelNamespacePrefixes, ..) are accepted for them. A boolean that
is not true or false is the default, as bool.TryParse fails.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedCloneDebugStructuralPartialEqPartialEqEqDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.