StaticViewLocatorBuild
struct · ferroui-static-view-locator-build · v0.5.0
struct StaticViewLocatorBuild
The generator of the locators of a crate, run by its build script.
Members
from_envnewcrate_namesource_rootview_model_namespace_prefixesinclude_internal_view_modelsinclude_referenced_cratesadditional_view_base_typesnamespace_replacement_rulestype_name_replacement_rulesstrip_generic_arity_from_view_nameinterface_prefixes_to_strippropertyoptionsreactiveui_availablewrite_filesrunexecute
from_env
fn from_env() -> Self
The generator of the crate whose build script is running: CARGO_MANIFEST_DIR, OUT_DIR,
CARGO_PKG_NAME (the name of the library when the crate states another one cannot be
read; state it with crate_name), the .xamlmeta of every direct
dependency, and whether ferroui-static-view-locator has the feature reactiveui
(DEP_FERROUI_STATIC_VIEW_LOCATOR_REACTIVEUI).
Panics
Panics outside a build script (a variable Cargo sets is missing).
new
fn new(manifest_dir: PathBuf, out_dir: PathBuf, package_name: &str, dependencies: Vec<PathBuf>) -> Self
The generator of the package package_name in manifest_dir, writing below out_dir,
with the .xamlmeta files of its direct dependencies.
crate_name
fn crate_name(self: Self, name: &str) -> Self
The name of the crate as Rust paths spell it, when the library has another name than the package.
source_root
fn source_root(self: Self, file: &str) -> Self
The root file of the sources, relative to the crate directory. Without the call:
src/lib.rs, lib.rs, else src/main.rs.
view_model_namespace_prefixes
fn view_model_namespace_prefixes<I: IntoIterator<Item = S>, S: AsRef<str>>(self: Self, prefixes: I) -> Self
The module paths view models are taken from (StaticViewLocatorViewModelNamespacePrefixes).
include_internal_view_models
fn include_internal_view_models(self: Self, include: bool) -> Self
StaticViewLocatorIncludeInternalViewModels; without an effect (see
GeneratorOptions::include_internal_view_models).
include_referenced_crates
fn include_referenced_crates(self: Self, include: bool) -> Self
Whether the view models of the crates the crate depends on are taken
(StaticViewLocatorIncludeReferencedAssemblies).
additional_view_base_types
fn additional_view_base_types<I: IntoIterator<Item = S>, S: AsRef<str>>(self: Self, types: I) -> Self
More view base types (StaticViewLocatorAdditionalViewBaseTypes).
namespace_replacement_rules
fn namespace_replacement_rules<I: IntoIterator<Item = (F, T)>, F: AsRef<str>, T: AsRef<str>>(self: Self, rules: I) -> Self
The namespace rules applied before the defaults (StaticViewLocatorNamespaceReplacementRules).
type_name_replacement_rules
fn type_name_replacement_rules<I: IntoIterator<Item = (F, T)>, F: AsRef<str>, T: AsRef<str>>(self: Self, rules: I) -> Self
The type name rules applied before the default (StaticViewLocatorTypeNameReplacementRules).
strip_generic_arity_from_view_name
fn strip_generic_arity_from_view_name(self: Self, strip: bool) -> Self
StaticViewLocatorStripGenericArityFromViewName (default true).
interface_prefixes_to_strip
fn interface_prefixes_to_strip<I: IntoIterator<Item = S>, S: AsRef<str>>(self: Self, prefixes: I) -> Self
The prefixes removed from the names of trait view models (StaticViewLocatorInterfacePrefixesToStrip).
property
fn property(self: Self, name: &str, value: &str) -> Self
Sets an option from its text, as an MSBuild property is read
(GeneratorOptions::set): property("type_name_replacement_rules", "ViewModel=View,Vm=Page").
options
fn options(self: Self, options: GeneratorOptions) -> Self
All the options at once.
reactiveui_available
fn reactiveui_available(self: Self, available: bool) -> Self
Whether ferroui-static-view-locator has the feature reactiveui; from_env
reads it from Cargo.
write_files
fn write_files(self: Self, write: bool) -> Self
Whether execute writes the generated files (default true); without, the
files are only in the Outcome.
run
fn run(self: Self)
Runs the generator and prints its lines and diagnostics for Cargo. On an error the process exits with a failure.
execute
fn execute(self: Self) -> Outcome
Runs the generator and returns what run prints, with the generated files.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>Any
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.