# NameTable

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

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

```rust
struct NameTable<V: Copy + 'static>
```

A table of values by the path of a generic type definition (`type.GetGenericTypeDefinition()`
as the key of the legacy fallback): the path of the declaration of the type, as
`std::any::type_name` writes it without its generic arguments
(`my_app::view_models::WidgetViewModel`).

Not an upstream type: a Rust generic type has no run-time definition, and the `TypeId` of each
of its instantiations is its own. The legacy fallback of the reference finds the view of
`WidgetViewModel<int>` through the definition `WidgetViewModel<>`; the port finds it through
the path of the definition, which `RuntimeType::generic_definition`
gives for a value.

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

## Members

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

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

### new

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

The table of `entries`, each a path and its value.

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

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

### get

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

The value of the path `path`, the first of the table.

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

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

### entries

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

The entries, in the order of the generated source.

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

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

### len

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

The number of entries.

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

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

### is_empty

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

Whether the table has no entry.

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

## 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/).
