# ViewAssembly

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui-controls/struct-viewassembly/

**struct** · [`ferroui-reactiveui-controls`](/docs/0.5.0/api/ferroui-reactiveui-controls/) · v0.5.0

```rust
struct ViewAssembly
```

The types of an application that hold its views (an assembly scanned upstream).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/view_registrar.rs#L50)

## Members

- [`name`](#struct_field-name)
- [`new`](#function-new)
- [`view`](#function-view)
- [`other_type`](#function-other_type)
- [`types`](#function-types)

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

### name

```rust
name: &'static str
```

The name of the assembly.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/view_registrar.rs#L52)

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

### new

```rust
fn new(name: &'static str) -> Self
```

An assembly without types.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/view_registrar.rs#L58)

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

### view

```rust
fn view<VM: 'static, V: IViewForOf<VM> + 'static>(self: Self, contract: Option<&str>, activator: fn() -> Rc<V>) -> Self
```

Adds the view type `V` of the view model type `VM` (a class that implements
`IViewFor<TViewModel>`), registered under `contract` (`[ViewContract("...")]`; `None` for
the default), and created by `activator` when the service locator has no `V`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/view_registrar.rs#L65)

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

### other_type

```rust
fn other_type<T: ?Sized + 'static>(self: Self, is_abstract: bool) -> Self
```

Adds a type that is not a view (it does not implement `IViewFor<TViewModel>`), or an
abstract one: the registrar skips it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/view_registrar.rs#L83)

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

### types

```rust
fn types(self: &Self) -> &[ViewAssemblyType]
```

The types of the assembly (`GetTypes()`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Controls/view_registrar.rs#L89)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Debug`
- `Default`

## Availability

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