# GeneratorOptions

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-static-view-locator-build/options/struct-generatoroptions/

**struct** · [`ferroui-static-view-locator-build`](/docs/0.5.0/api/ferroui-static-view-locator-build/) · v0.5.0

```rust
struct GeneratorOptions
```

The options of the generator (`GeneratorOptions`).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator.Build/options.rs#L36)

## Members

- [`namespace_prefixes`](#struct_field-namespace_prefixes)
- [`include_internal_view_models`](#struct_field-include_internal_view_models)
- [`include_referenced_crates`](#struct_field-include_referenced_crates)
- [`additional_view_base_types`](#struct_field-additional_view_base_types)
- [`namespace_replacement_rules`](#struct_field-namespace_replacement_rules)
- [`type_name_replacement_rules`](#struct_field-type_name_replacement_rules)
- [`strip_generic_arity_from_view_name`](#struct_field-strip_generic_arity_from_view_name)
- [`interface_prefixes_to_strip`](#struct_field-interface_prefixes_to_strip)
- [`effective_namespace_rules`](#function-effective_namespace_rules)
- [`effective_type_name_rules`](#function-effective_type_name_rules)
- [`set`](#function-set)

<a id="struct_field-namespace_prefixes"></a>

### namespace_prefixes

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator.Build/options.rs#L40)

<a id="struct_field-include_internal_view_models"></a>

### include_internal_view_models

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator.Build/options.rs#L44)

<a id="struct_field-include_referenced_crates"></a>

### include_referenced_crates

```rust
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`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator.Build/options.rs#L48)

<a id="struct_field-additional_view_base_types"></a>

### additional_view_base_types

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator.Build/options.rs#L51)

<a id="struct_field-namespace_replacement_rules"></a>

### namespace_replacement_rules

```rust
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`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator.Build/options.rs#L54)

<a id="struct_field-type_name_replacement_rules"></a>

### type_name_replacement_rules

```rust
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`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator.Build/options.rs#L57)

<a id="struct_field-strip_generic_arity_from_view_name"></a>

### strip_generic_arity_from_view_name

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator.Build/options.rs#L60)

<a id="struct_field-interface_prefixes_to_strip"></a>

### interface_prefixes_to_strip

```rust
interface_prefixes_to_strip: Vec<String>
```

Removed from the name of a trait view model before its view is looked up
(`StaticViewLocatorInterfacePrefixesToStrip`, default `I`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator.Build/options.rs#L63)

<a id="function-effective_namespace_rules"></a>

### effective_namespace_rules

```rust
fn effective_namespace_rules(self: &Self) -> Vec<ReplacementRule>
```

The namespace rules applied in order: the configured ones, then the defaults
(`GetReplacementRules`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator.Build/options.rs#L84)

<a id="function-effective_type_name_rules"></a>

### effective_type_name_rules

```rust
fn effective_type_name_rules(self: &Self) -> Vec<ReplacementRule>
```

The type name rules applied in order: the configured ones, then the default.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator.Build/options.rs#L91)

<a id="function-set"></a>

### set

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator.Build/options.rs#L105)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Default`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
