pub trait InboundChannel: Send + Sync {
// Required methods
fn channel(&self) -> ChannelId;
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
sink: &'life1 dyn InboundSink,
cancel: Receiver<bool>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}Expand description
The inbound seam — the abstraction #403 never had. Each channel adapter
implements this: it names its ChannelId and OWNS its own run loop,
feeding observed messages into the supplied InboundSink. Object-safe via
#[async_trait] (the cross-platform registry holds Box<dyn InboundChannel>).
run() is async — each adapter drives its own cadence: iMessage polls on a
bounded interval; Slack holds a Socket Mode WebSocket. Neither fakes the
other’s model.
Required Methods§
Sourcefn run<'life0, 'life1, 'async_trait>(
&'life0 self,
sink: &'life1 dyn InboundSink,
cancel: Receiver<bool>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
sink: &'life1 dyn InboundSink,
cancel: Receiver<bool>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Run the adapter’s inbound loop until cancel flips to true. The
adapter feeds every observed inbound message to sink.deliver(...).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl InboundChannel for SlackAdapter
The Slack adapter implements the channel-agnostic InboundChannel seam:
it names ChannelId::Slack and OWNS its push-based inbound loop, pulling
events off the SlackTransport and dispatching each. UNCONDITIONAL — no
cfg gate (MC-11).
Note on the sink: like the iMessage adapter, the Slack adapter is its own
delivery path. Its inbound is button-clicks (resolve by approval_id) and
pairing DMs (the code primitive) — neither maps to the handle_id+body
InboundMessage sink shape, so the passed sink is unused here (the seam’s
sink param exists for a hypothetical adapter whose delivery is externally
supplied; Slack, like iMessage, delivers internally and honestly does not
fake an InboundMessage).