# IFerroDictionary

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/collections/trait-iferrodictionary/

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

```rust
trait IFerroDictionary<K, V>: IFerroReadOnlyDictionary<K, V>
```

A notifying dictionary.

The members of the dictionary contract it extends are part of the trait.

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

## Members

- [`set`](#function-set)
- [`add`](#function-add)
- [`remove`](#function-remove)
- [`clear`](#function-clear)
- [`is_read_only`](#function-is_read_only)

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

### set

```rust
fn set(self: &Self, key: K, value: V)
```

Sets the value for `key`, adding the entry if it is not present.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/collections/i_ferro_dictionary.rs#L10)

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

### add

```rust
fn add(self: &Self, key: K, value: V)
```

Adds an entry. Panics if the key is already present.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/collections/i_ferro_dictionary.rs#L13)

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

### remove

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

Removes the entry for `key`. Returns false if it is not present.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/collections/i_ferro_dictionary.rs#L16)

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

### clear

```rust
fn clear(self: &Self)
```

Removes all entries.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/collections/i_ferro_dictionary.rs#L19)

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

### is_read_only

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/collections/i_ferro_dictionary.rs#L21)

## Trait implementations

- [`IFerroDictionary<K, V>`](/docs/0.5.0/api/ferroui-base/collections/trait-iferrodictionary/)

## Availability

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