# BidiDictionary

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

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

```rust
struct BidiDictionary<T1, T2>
```

A simple bi-directional dictionary.

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

## Members

- [`new`](#function-new)
- [`clear_then_reset_if_too_large`](#function-clear_then_reset_if_too_large)
- [`add`](#function-add)
- [`try_get_value`](#function-try_get_value)
- [`try_get_key`](#function-try_get_key)
- [`contains_key`](#function-contains_key)
- [`contains_value`](#function-contains_value)

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

### new

```rust
fn new() -> Self
```



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

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

### clear_then_reset_if_too_large

```rust
fn clear_then_reset_if_too_large(self: &mut Self)
```



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

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

### add

```rust
fn add(self: &mut Self, key: T1, value: T2)
```

Panics when the key or the value has been added already.

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

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

### try_get_value

```rust
fn try_get_value(self: &Self, key: &T1) -> Option<&T2>
```



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

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

### try_get_key

```rust
fn try_get_key(self: &Self, value: &T2) -> Option<&T1>
```



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

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

### contains_key

```rust
fn contains_key(self: &Self, key: &T1) -> bool
```



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

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

### contains_value

```rust
fn contains_value(self: &Self, value: &T2) -> bool
```



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

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

## Availability

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