1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Channel trait definition.
//!
//! A channel is a plugin that connects the gateway to a specific
//! interface (Web, CLI, Telegram, etc.).
//!
//! Channels implement [`Channel::start`] to push incoming messages
//! into a shared mpsc channel, and [`Channel::send`] for outgoing
//! responses.
use Result;
use async_trait;
use ;
use JoinHandle;
use crateOutgoingMessage;
use crateGatewayInbox;
/// A communication channel that plugs into the gateway.
///
/// Each channel runs its own background task (started via [`Channel::start`])
/// and pushes incoming messages into the gateway's shared mpsc channel.
/// The gateway dispatches responses back via [`Channel::send`].