# TypeTable

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

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

```rust
struct TypeTable<V: Copy + Send + Sync + 'static>
```

A table of values by type (`Dictionary<Type, V>` of the generated source), declared as a
static of constant entries and indexed on its first lookup. Of two entries of one type the
first is the value.

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

## Members

- [`new`](#function-new)
- [`get`](#function-get)
- [`contains`](#function-contains)
- [`entries`](#function-entries)
- [`len`](#function-len)
- [`is_empty`](#function-is_empty)

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

### new

```rust
const fn new(entries: &'static [TypeEntry<V>]) -> Self
```

The table of `entries`.

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

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

### get

```rust
fn get(self: &Self, type_id: TypeId) -> Option<V>
```

The value of the type `type_id` (`TryGetValue`).

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

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

### contains

```rust
fn contains(self: &Self, type_id: TypeId) -> bool
```

Whether the table has a value for the type `type_id` (`ContainsKey`).

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

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

### entries

```rust
fn entries(self: &Self) -> &'static [TypeEntry<V>]
```

The entries, in the order of the generated source.

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

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

### len

```rust
fn len(self: &Self) -> usize
```

The number of types of the table (`Count`).

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

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

### is_empty

```rust
fn is_empty(self: &Self) -> bool
```

Whether the table has no type.

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

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

## Availability

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