core_crypto/mls/conversation/immutable_conversation/
mod.rs1use super::{ConversationWithMls, MlsConversation, Result};
2use crate::prelude::Session;
3
4pub struct ImmutableConversation {
8 inner: MlsConversation,
9 client: Session,
10}
11
12#[cfg_attr(target_family = "wasm", async_trait::async_trait(?Send))]
13#[cfg_attr(not(target_family = "wasm"), async_trait::async_trait)]
14impl<'inner> ConversationWithMls<'inner> for ImmutableConversation {
15 type Context = Session;
16
17 type Conversation = &'inner MlsConversation;
18
19 async fn context(&self) -> Result<Session> {
20 Ok(self.client.clone())
21 }
22
23 async fn conversation(&'inner self) -> &'inner MlsConversation {
24 &self.inner
25 }
26}
27
28impl ImmutableConversation {
29 pub(crate) fn new(inner: MlsConversation, client: Session) -> Self {
30 Self { inner, client }
31 }
32}