# RuntimeType

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

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

```rust
struct RuntimeType
```

The run-time type of a view model: the `TypeId` the generated tables are keyed by and the path
of the type (`Type` of the generated source, with `FullName`).

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

## Members

- [`of`](#function-of)
- [`new`](#function-new)
- [`of_value`](#function-of_value)
- [`of_any`](#function-of_any)
- [`id`](#function-id)
- [`name`](#function-name)
- [`generic_definition`](#function-generic_definition)

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

### of

```rust
fn of<T: ?Sized + 'static>() -> Self
```

The type `T`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator/runtime_type.rs#L23)

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

### new

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

The type of the id `id`, named `name`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator/runtime_type.rs#L28)

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

### of_value

```rust
fn of_value(value: &BoxedValue) -> Self
```

The run-time type of the view model `value` (`value.GetType()`):

- an object of the class model (`Ref<T>`, or a registered handle of one) is of the handle
  type of its class (`Ref<T>`), which the generator keys the classes by;
- the handle `Rc<T>` of a registered reference type is of `T`;
- with the feature `reactiveui`, an untyped view model (`UntypedViewModel`) is of the type
  of the view model it holds;
- any other value is of its own type.

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

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

### of_any

```rust
fn of_any(value: &dyn Any) -> Self
```

The run-time type of a view model held as `dyn Any` (the view models of ReactiveUI). Its
path is not known: `std::any::type_name` needs the static type.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator/runtime_type.rs#L59)

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

### id

```rust
fn id(self: &Self) -> TypeId
```

The id of the type.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator/runtime_type.rs#L64)

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

### name

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

The path of the type (`FullName`), as `std::any::type_name` writes it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator/runtime_type.rs#L69)

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

### generic_definition

```rust
fn generic_definition(self: &Self) -> Option<&'static str>
```

The path of the generic type definition of the type, without its generic arguments
(`my_app::WidgetViewModel` of `my_app::WidgetViewModel<i32>`); `None` for a type that is
not generic (`IsGenericType` and `GetGenericTypeDefinition()`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/StaticViewLocator/FerroUI.StaticViewLocator/runtime_type.rs#L76)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `ToString`
- [`ResourceKeyObject`](/docs/0.5.0/api/ferroui-base/controls/trait-resourcekeyobject/)
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `Copy`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Hash`
- `Debug`
- `Display`

## Availability

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