Skip to main content

XmtpMlsBidiStreams

Trait XmtpMlsBidiStreams 

Source
pub trait XmtpMlsBidiStreams: MaybeSend + MaybeSync {
    type SubscribeStream: Stream<Item = Result<SubscribeResponse, Self::Error>> + MaybeSend;
    type Error: RetryableError + 'static;

    // Required method
    fn subscribe_bidi<'life0, 'async_trait>(
        &'life0 self,
        requests: BoxStream<'static, SubscribeRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Self::SubscribeStream, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The XIP-83 bidirectional subscription: one long-lived stream carrying group and welcome messages, mutated in place (no reconnect on membership change) and kept alive with WebSocket-style ping/pong. Native-only — gRPC-Web transports cannot speak full-duplex, so browsers stay on XmtpMlsStreams with a client-side watchdog.

Required Associated Types§

Required Methods§

Source

fn subscribe_bidi<'life0, 'async_trait>( &'life0 self, requests: BoxStream<'static, SubscribeRequest>, ) -> Pin<Box<dyn Future<Output = Result<Self::SubscribeStream, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Open the bidirectional stream. requests is the outbound client→server frame stream (typically fed by a channel; the first frame is usually a Mutate naming the initial topic set); the returned stream yields the server→client frames.

Implementations on Foreign Types§

Source§

impl<T> XmtpMlsBidiStreams for Box<T>

Source§

type Error = <T as XmtpMlsBidiStreams>::Error

Source§

type SubscribeStream = <T as XmtpMlsBidiStreams>::SubscribeStream

Source§

fn subscribe_bidi<'life0, 'async_trait>( &'life0 self, requests: BoxStream<'static, SubscribeRequest>, ) -> Pin<Box<dyn Future<Output = Result<Self::SubscribeStream, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl<T> XmtpMlsBidiStreams for Arc<T>

Source§

type Error = <T as XmtpMlsBidiStreams>::Error

Source§

type SubscribeStream = <T as XmtpMlsBidiStreams>::SubscribeStream

Source§

fn subscribe_bidi<'life0, 'async_trait>( &'life0 self, requests: BoxStream<'static, SubscribeRequest>, ) -> Pin<Box<dyn Future<Output = Result<Self::SubscribeStream, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§