# MessageKey

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/interfaces/struct-messagekey/

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

```rust
struct MessageKey
```

The channel of a message bus: the type of the messages and the contract that tells apart the
messages of one type (the key `(Type, string? Contract)` of upstream's `MessageBus`).

No contract (`None`) and the empty contract are two channels, as upstream's `null` and `""`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/interfaces/i_message_bus.rs#L15)

## Members

- [`of`](#function-of)
- [`new`](#function-new)
- [`message_type`](#function-message_type)
- [`type_name`](#function-type_name)
- [`contract`](#function-contract)

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

### of

```rust
fn of<T: 'static>(contract: Option<&str>) -> Self
```

The channel of the messages of type `T` with `contract`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/interfaces/i_message_bus.rs#L23)

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

### new

```rust
fn new(message_type: TypeId, type_name: &'static str, contract: Option<&str>) -> Self
```

The channel of the messages of the type `message_type` with `contract`; `type_name` is
the name the logs show.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/interfaces/i_message_bus.rs#L29)

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

### message_type

```rust
fn message_type(self: &Self) -> TypeId
```

The type of the messages.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/interfaces/i_message_bus.rs#L34)

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

### type_name

```rust
fn type_name(self: &Self) -> &'static str
```

The name of the type of the messages.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/interfaces/i_message_bus.rs#L39)

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

### contract

```rust
fn contract(self: &Self) -> Option<&str>
```

The contract of the channel.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/interfaces/i_message_bus.rs#L44)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `Clone`
- `PartialEq`
- `Eq`
- `Hash`
- `Debug`

## Availability

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