# instantiate

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/function-instantiate/

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

```rust
fn instantiate<T: ObjectType>(value: T) -> Ref<T>
```

Moves a constructed class value to the heap, attaches the virtual table of
its class and runs the `constructed` virtual member. The class (and its
base classes) are initialised first if this is the first instance on the
thread; see `ObjectType::register_class`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/type_system.rs#L1218)

## Availability

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