# TypeGraph

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-build/theme_roots/struct-typegraph/

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

```rust
struct TypeGraph
```

The edges between types that make a type live with another, by local name: the base class
of a class (what keeps the theme of a base class for a class that does not override its
style key) and the classes the code of a class creates (#568, step 4: the containers a
`ListBox` creates, the selection handles of a `TextBox`).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Build.Tasks/theme_roots.rs#L139)

## Members

- [`from_models`](#function-from_models)
- [`from_pairs`](#function-from_pairs)
- [`with_creates`](#function-with_creates)
- [`is_class`](#function-is_class)
- [`chain`](#function-chain)
- [`live`](#function-live)

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

### from_models

```rust
fn from_models<'m>(models: impl IntoIterator<Item = &'m AssemblyModel>) -> Self
```

The edges the models state: for each class of the object model with a base class, the
markup name of the base, found by its Rust name; for each type that creates classes, their
local names.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Build.Tasks/theme_roots.rs#L164)

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

### from_pairs

```rust
fn from_pairs(pairs: &[(&str, &str)]) -> Self
```

The base classes stated as pairs `(class, base)`, for the tests.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Build.Tasks/theme_roots.rs#L195)

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

### with_creates

```rust
fn with_creates(self: Self, pairs: &[(&str, &str)]) -> Self
```

The graph with the creates edges stated as pairs `(class, created)`, for the tests.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Build.Tasks/theme_roots.rs#L200)

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

### is_class

```rust
fn is_class(self: &Self, name: &str) -> bool
```

Whether `name` is a class of the object model of the models, or a class of an edge.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Build.Tasks/theme_roots.rs#L210)

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

### chain

```rust
fn chain(self: &Self, name: &str) -> Vec<String>
```

`name` and its base classes, nearest first.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Build.Tasks/theme_roots.rs#L215)

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

### live

```rust
fn live(self: &Self, name: &str) -> BTreeSet<String>
```

The types that are live when `name` is: `name`, its base classes, the classes any of them
creates, and so on, transitively.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Build.Tasks/theme_roots.rs#L228)

## Trait implementations

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

## Availability

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