Skip to main content

XmtpMlsStreams

Trait XmtpMlsStreams 

Source
pub trait XmtpMlsStreams: MaybeSend + MaybeSync {
    type GroupMessageStream: Stream<Item = Result<GroupMessage, Self::Error>> + MaybeSend;
    type WelcomeMessageStream: Stream<Item = Result<WelcomeMessage, Self::Error>> + MaybeSend;
    type Error: RetryableError + 'static;

    // Required methods
    fn subscribe_envelopes_with_cursors<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cursors: &'life1 HashMap<Topic, Cursor>,
        limits: IncomingBatchLimits,
    ) -> Pin<Box<dyn Future<Output = Result<IncomingSubscription<Self::Error>, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn subscribe_group_messages<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        group_ids: &'life1 [&'life2 GroupId],
    ) -> Pin<Box<dyn Future<Output = Result<Self::GroupMessageStream, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn subscribe_group_messages_with_cursors<'life0, 'life1, 'async_trait>(
        &'life0 self,
        groups_with_cursors: &'life1 HashMap<Topic, Cursor>,
    ) -> Pin<Box<dyn Future<Output = Result<Self::GroupMessageStream, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn subscribe_welcome_messages<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        installations: &'life1 [&'life2 InstallationId],
    ) -> Pin<Box<dyn Future<Output = Result<Self::WelcomeMessageStream, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn subscribe_welcome_messages_with_cursors<'life0, 'life1, 'async_trait>(
        &'life0 self,
        cursors: &'life1 HashMap<Topic, Cursor>,
    ) -> Pin<Box<dyn Future<Output = Result<Self::WelcomeMessageStream, Self::Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
}
Expand description

Represents the backend API required for an MLS Delivery Service to be compatible with XMTP streaming

Required Associated Types§

Required Methods§

Source

fn subscribe_envelopes_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, limits: IncomingBatchLimits, ) -> Pin<Box<dyn Future<Output = Result<IncomingSubscription<Self::Error>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Subscribe after committed receipt positions without decoding MLS payloads. Acknowledge new positions only after the raw envelopes commit to storage.

Source

fn subscribe_group_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, group_ids: &'life1 [&'life2 GroupId], ) -> Pin<Box<dyn Future<Output = Result<Self::GroupMessageStream, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Source

fn subscribe_group_messages_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, groups_with_cursors: &'life1 HashMap<Topic, Cursor>, ) -> Pin<Box<dyn Future<Output = Result<Self::GroupMessageStream, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn subscribe_welcome_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, installations: &'life1 [&'life2 InstallationId], ) -> Pin<Box<dyn Future<Output = Result<Self::WelcomeMessageStream, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Source

fn subscribe_welcome_messages_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, ) -> Pin<Box<dyn Future<Output = Result<Self::WelcomeMessageStream, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Implementations on Foreign Types§

Source§

impl<C> XmtpMlsStreams for BackendClient<C>
where C: Client,

Source§

type Error = ApiClientError

Source§

type GroupMessageStream = Pin<Box<dyn Stream<Item = Result<GroupMessage, ApiClientError>> + Send>>

Source§

type WelcomeMessageStream = Pin<Box<dyn Stream<Item = Result<WelcomeMessage, ApiClientError>> + Send>>

Source§

fn subscribe_envelopes_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, limits: IncomingBatchLimits, ) -> Pin<Box<dyn Future<Output = Result<IncomingSubscription<<BackendClient<C> as XmtpMlsStreams>::Error>, <BackendClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, BackendClient<C>: 'async_trait,

Source§

fn subscribe_group_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, groups: &'life1 [&'life2 GroupId], ) -> Pin<Box<dyn Future<Output = Result<<BackendClient<C> as XmtpMlsStreams>::GroupMessageStream, <BackendClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, BackendClient<C>: 'async_trait,

Source§

fn subscribe_group_messages_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, ) -> Pin<Box<dyn Future<Output = Result<<BackendClient<C> as XmtpMlsStreams>::GroupMessageStream, <BackendClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, BackendClient<C>: 'async_trait,

Source§

fn subscribe_welcome_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, installations: &'life1 [&'life2 InstallationId], ) -> Pin<Box<dyn Future<Output = Result<<BackendClient<C> as XmtpMlsStreams>::WelcomeMessageStream, <BackendClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, BackendClient<C>: 'async_trait,

Source§

fn subscribe_welcome_messages_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, ) -> Pin<Box<dyn Future<Output = Result<<BackendClient<C> as XmtpMlsStreams>::WelcomeMessageStream, <BackendClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, BackendClient<C>: 'async_trait,

Source§

impl<C> XmtpMlsStreams for TrackedStatsClient<C>
where C: XmtpMlsStreams,

Source§

type Error = <C as XmtpMlsStreams>::Error

Source§

type GroupMessageStream = <C as XmtpMlsStreams>::GroupMessageStream

Source§

type WelcomeMessageStream = <C as XmtpMlsStreams>::WelcomeMessageStream

Source§

fn subscribe_envelopes_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, limits: IncomingBatchLimits, ) -> Pin<Box<dyn Future<Output = Result<IncomingSubscription<<TrackedStatsClient<C> as XmtpMlsStreams>::Error>, <TrackedStatsClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, TrackedStatsClient<C>: 'async_trait,

Source§

fn subscribe_group_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, groups: &'life1 [&'life2 GroupId], ) -> Pin<Box<dyn Future<Output = Result<<TrackedStatsClient<C> as XmtpMlsStreams>::GroupMessageStream, <TrackedStatsClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, TrackedStatsClient<C>: 'async_trait,

Source§

fn subscribe_group_messages_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, groups: &'life1 HashMap<Topic, Cursor>, ) -> Pin<Box<dyn Future<Output = Result<<TrackedStatsClient<C> as XmtpMlsStreams>::GroupMessageStream, <TrackedStatsClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, TrackedStatsClient<C>: 'async_trait,

Source§

fn subscribe_welcome_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, installations: &'life1 [&'life2 InstallationId], ) -> Pin<Box<dyn Future<Output = Result<<TrackedStatsClient<C> as XmtpMlsStreams>::WelcomeMessageStream, <TrackedStatsClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, TrackedStatsClient<C>: 'async_trait,

Source§

fn subscribe_welcome_messages_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, installations: &'life1 HashMap<Topic, Cursor>, ) -> Pin<Box<dyn Future<Output = Result<<TrackedStatsClient<C> as XmtpMlsStreams>::WelcomeMessageStream, <TrackedStatsClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, TrackedStatsClient<C>: 'async_trait,

Source§

impl<C> XmtpMlsStreams for BoxedStreamsClient<C>

Source§

type Error = <C as XmtpMlsStreams>::Error

Source§

type GroupMessageStream = Pin<Box<dyn Stream<Item = Result<GroupMessage, <C as XmtpMlsStreams>::Error>> + Send>>

Source§

type WelcomeMessageStream = Pin<Box<dyn Stream<Item = Result<WelcomeMessage, <C as XmtpMlsStreams>::Error>> + Send>>

Source§

fn subscribe_envelopes_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, limits: IncomingBatchLimits, ) -> Pin<Box<dyn Future<Output = Result<IncomingSubscription<<BoxedStreamsClient<C> as XmtpMlsStreams>::Error>, <BoxedStreamsClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, BoxedStreamsClient<C>: 'async_trait,

Source§

fn subscribe_group_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, groups: &'life1 [&'life2 GroupId], ) -> Pin<Box<dyn Future<Output = Result<<BoxedStreamsClient<C> as XmtpMlsStreams>::GroupMessageStream, <BoxedStreamsClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, BoxedStreamsClient<C>: 'async_trait,

Source§

fn subscribe_group_messages_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, groups: &'life1 HashMap<Topic, Cursor>, ) -> Pin<Box<dyn Future<Output = Result<<BoxedStreamsClient<C> as XmtpMlsStreams>::GroupMessageStream, <BoxedStreamsClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, BoxedStreamsClient<C>: 'async_trait,

Source§

fn subscribe_welcome_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, installations: &'life1 [&'life2 InstallationId], ) -> Pin<Box<dyn Future<Output = Result<<BoxedStreamsClient<C> as XmtpMlsStreams>::WelcomeMessageStream, <BoxedStreamsClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, BoxedStreamsClient<C>: 'async_trait,

Source§

fn subscribe_welcome_messages_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, installations: &'life1 HashMap<Topic, Cursor>, ) -> Pin<Box<dyn Future<Output = Result<<BoxedStreamsClient<C> as XmtpMlsStreams>::WelcomeMessageStream, <BoxedStreamsClient<C> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, BoxedStreamsClient<C>: 'async_trait,

Source§

impl<T> XmtpMlsStreams for &T
where T: XmtpMlsStreams + ?Sized,

Source§

type Error = <T as XmtpMlsStreams>::Error

Source§

type GroupMessageStream = <T as XmtpMlsStreams>::GroupMessageStream

Source§

type WelcomeMessageStream = <T as XmtpMlsStreams>::WelcomeMessageStream

Source§

fn subscribe_envelopes_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, limits: IncomingBatchLimits, ) -> Pin<Box<dyn Future<Output = Result<IncomingSubscription<<&T as XmtpMlsStreams>::Error>, <&T as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, &T: 'async_trait,

Source§

fn subscribe_group_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, group_ids: &'life1 [&'life2 GroupId], ) -> Pin<Box<dyn Future<Output = Result<<&T as XmtpMlsStreams>::GroupMessageStream, <&T as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, &T: 'async_trait,

Source§

fn subscribe_group_messages_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, ) -> Pin<Box<dyn Future<Output = Result<<&T as XmtpMlsStreams>::GroupMessageStream, <&T as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, &T: 'async_trait,

Source§

fn subscribe_welcome_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, installations: &'life1 [&'life2 InstallationId], ) -> Pin<Box<dyn Future<Output = Result<<&T as XmtpMlsStreams>::WelcomeMessageStream, <&T as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, &T: 'async_trait,

Source§

fn subscribe_welcome_messages_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, ) -> Pin<Box<dyn Future<Output = Result<<&T as XmtpMlsStreams>::WelcomeMessageStream, <&T as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, &T: 'async_trait,

Source§

impl<T> XmtpMlsStreams for Box<T>
where T: XmtpMlsStreams + ?Sized,

Source§

type Error = <T as XmtpMlsStreams>::Error

Source§

type GroupMessageStream = <T as XmtpMlsStreams>::GroupMessageStream

Source§

type WelcomeMessageStream = <T as XmtpMlsStreams>::WelcomeMessageStream

Source§

fn subscribe_envelopes_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, limits: IncomingBatchLimits, ) -> Pin<Box<dyn Future<Output = Result<IncomingSubscription<<Box<T> as XmtpMlsStreams>::Error>, <Box<T> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<T>: 'async_trait,

Source§

fn subscribe_group_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, group_ids: &'life1 [&'life2 GroupId], ) -> Pin<Box<dyn Future<Output = Result<<Box<T> as XmtpMlsStreams>::GroupMessageStream, <Box<T> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Box<T>: 'async_trait,

Source§

fn subscribe_group_messages_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, ) -> Pin<Box<dyn Future<Output = Result<<Box<T> as XmtpMlsStreams>::GroupMessageStream, <Box<T> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<T>: 'async_trait,

Source§

fn subscribe_welcome_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, installations: &'life1 [&'life2 InstallationId], ) -> Pin<Box<dyn Future<Output = Result<<Box<T> as XmtpMlsStreams>::WelcomeMessageStream, <Box<T> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Box<T>: 'async_trait,

Source§

fn subscribe_welcome_messages_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, ) -> Pin<Box<dyn Future<Output = Result<<Box<T> as XmtpMlsStreams>::WelcomeMessageStream, <Box<T> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Box<T>: 'async_trait,

Source§

impl<T> XmtpMlsStreams for Arc<T>
where T: XmtpMlsStreams + ?Sized,

Source§

type Error = <T as XmtpMlsStreams>::Error

Source§

type GroupMessageStream = <T as XmtpMlsStreams>::GroupMessageStream

Source§

type WelcomeMessageStream = <T as XmtpMlsStreams>::WelcomeMessageStream

Source§

fn subscribe_envelopes_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, limits: IncomingBatchLimits, ) -> Pin<Box<dyn Future<Output = Result<IncomingSubscription<<Arc<T> as XmtpMlsStreams>::Error>, <Arc<T> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<T>: 'async_trait,

Source§

fn subscribe_group_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, group_ids: &'life1 [&'life2 GroupId], ) -> Pin<Box<dyn Future<Output = Result<<Arc<T> as XmtpMlsStreams>::GroupMessageStream, <Arc<T> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Arc<T>: 'async_trait,

Source§

fn subscribe_group_messages_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, ) -> Pin<Box<dyn Future<Output = Result<<Arc<T> as XmtpMlsStreams>::GroupMessageStream, <Arc<T> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<T>: 'async_trait,

Source§

fn subscribe_welcome_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, installations: &'life1 [&'life2 InstallationId], ) -> Pin<Box<dyn Future<Output = Result<<Arc<T> as XmtpMlsStreams>::WelcomeMessageStream, <Arc<T> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Arc<T>: 'async_trait,

Source§

fn subscribe_welcome_messages_with_cursors<'life0, 'life1, 'async_trait>( &'life0 self, cursors: &'life1 HashMap<Topic, Cursor>, ) -> Pin<Box<dyn Future<Output = Result<<Arc<T> as XmtpMlsStreams>::WelcomeMessageStream, <Arc<T> as XmtpMlsStreams>::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Arc<T>: 'async_trait,

Implementors§