# Struct DmChannel

> A DM channel: an ordinary channel object of kind `dm` with its two participants.

`zaun_client::DmChannel` · Struct

```rust
pub struct DmChannel { … }
```

A DM channel: an ordinary channel object of kind `dm` with its two participants.

## Fields

### `channel_id: ChannelId`

The channel.

### `participants: [MemberId; 2]`

Its two members, sorted.

### `rest: Map<String, Value>`

The rest of the channel object, as the host sent it.

## Methods

### `between`

```rust
pub fn between(channel_id: ChannelId, a: MemberId, b: MemberId) -> Self
```

A DM learnt only from a message in it: the two members, no other field.

### `from_channel`

```rust
pub fn from_channel(channel: &Channel) -> Option<Self>
```

The DM a channel object describes; `None` for any other kind of channel, or a DM
without exactly two participants.

### `other`

```rust
pub fn other(&self, me: MemberId) -> MemberId
```

The participant who is not `me` (`me` when both are).

## Trait implementations

`Clone`, `Debug`, `Deserialize<'de>`, `Eq`, `PartialEq`, `Serialize`, `StructuralPartialEq`

[Full rustdoc page](/docs/api/rust/zaun-client/zaun_client/dm/wire/struct.DmChannel.html)
