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§
type GroupMessageStream: Stream<Item = Result<GroupMessage, Self::Error>> + MaybeSend
type WelcomeMessageStream: Stream<Item = Result<WelcomeMessage, Self::Error>> + MaybeSend
type Error: RetryableError + 'static
Required Methods§
Sourcefn 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_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.