# RefCountingSmallDictionary

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/utilities/struct-refcountingsmalldictionary/

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

```rust
struct RefCountingSmallDictionary<TKey>
```

Counts the references to keys in an [`InlineDictionary`](/docs/0.5.0/api/ferroui-base/utilities/struct-inlinedictionary/).

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

## Members

- [`add`](#function-add)
- [`remove`](#function-remove)
- [`get_enumerator`](#function-get_enumerator)

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

### add

```rust
fn add(self: &mut Self, key: TKey) -> bool
```

Adds a reference to the key. Returns whether it is the first one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/ref_counting_small_dictionary.rs#L17)

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

### remove

```rust
fn remove(self: &mut Self, key: &TKey) -> bool
```

Removes a reference to the key. Returns whether it was the last one.

Panics when the key has no reference.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/ref_counting_small_dictionary.rs#L26)

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

### get_enumerator

```rust
fn get_enumerator(self: &Self) -> InlineDictionaryEnumerator<'_, TKey, i32>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/utilities/ref_counting_small_dictionary.rs#L42)

## Trait implementations

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

## Availability

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