# ViewContract

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/binding/view/struct-viewcontract/

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

```rust
struct ViewContract
```

The contract a view is registered under, so that one view model has a view per contract
(`ViewContractAttribute`): an option of a view registration
(`ViewRegistrationOptions`).

Deviation (DEVIATIONS.md, ReactiveUI): upstream's attributes on a view class are read by the
source generator that builds the view dispatch; here they are plain data given to
`ViewRegistrations`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/view/view_contract_attribute.rs#L11)

## Members

- [`new`](#function-new)
- [`contract`](#function-contract)

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

### new

```rust
fn new(contract: impl Into<String>) -> Self
```

The contract `contract` (`ViewContractAttribute(string)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/view/view_contract_attribute.rs#L17)

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

### contract

```rust
fn contract(self: &Self) -> &str
```

The contract to resolve the view under (`Contract`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/view/view_contract_attribute.rs#L22)

## 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`
- `Hash`

## Availability

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