FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

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

    Source

    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.

    Source

    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

    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.

    Source

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

    Source

    include_internal_view_models

    fn include_internal_view_models(self: Self, include: bool) -> Self
    

    StaticViewLocatorIncludeInternalViewModels; without an effect (see GeneratorOptions::include_internal_view_models).

    Source

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

    Source

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

    Source

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

    Source

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

    Source

    strip_generic_arity_from_view_name

    fn strip_generic_arity_from_view_name(self: Self, strip: bool) -> Self
    

    StaticViewLocatorStripGenericArityFromViewName (default true).

    Source

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

    Source

    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").

    Source

    options

    fn options(self: Self, options: GeneratorOptions) -> Self
    

    All the options at once.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    execute

    fn execute(self: Self) -> Outcome
    

    Runs the generator and returns what run prints, with the generated files.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<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.