Skip to main content

ConversationPluginsFactory

Trait ConversationPluginsFactory 

Source
pub trait ConversationPluginsFactory {
    type Mls: MlsService;
    type Scoring: PeerScoringPlugin;
    type StewardList: StewardListPlugin;

    // Required methods
    fn create_mls(&self, conversation_id: String) -> Result<Self::Mls, MlsError>;
    fn welcome_mls(
        &self,
        welcome_bytes: &[u8],
    ) -> Result<Option<Self::Mls>, MlsError>;
    fn make_scoring(&self, config: &ScoringConfig) -> Self::Scoring;
    fn make_steward_list(
        &self,
        conversation_id: &[u8],
        config: StewardListConfig,
    ) -> Self::StewardList;
    fn generate_key_package(&self) -> Result<KeyPackageBytes, MlsError>;
}
Expand description

Per-conversation plug-in bundle. One trait carries the three plug-in types (Mls, Scoring, StewardList) plus the construction methods for each. Identity is intentionally not part of this bundle — it lives parallel to the conversation registry as Arc<dyn Identity> on User.

Required Associated Types§

Required Methods§

Source

fn create_mls(&self, conversation_id: String) -> Result<Self::Mls, MlsError>

Build an MLS service for a brand-new conversation as its sole creator.

Source

fn welcome_mls( &self, welcome_bytes: &[u8], ) -> Result<Option<Self::Mls>, MlsError>

Try to build an MLS service from a serialized MLS welcome. Returns Ok(None) when the welcome isn’t for us.

Source

fn make_scoring(&self, config: &ScoringConfig) -> Self::Scoring

Build a fresh peer-scoring plug-in for a new conversation runner.

Source

fn make_steward_list( &self, conversation_id: &[u8], config: StewardListConfig, ) -> Self::StewardList

Build a fresh steward-list plug-in for a new conversation runner. Returns an empty plug-in; the lifecycle creator path bootstraps it via StewardListPlugin::install_list.

Source

fn generate_key_package(&self) -> Result<KeyPackageBytes, MlsError>

Mint a single-use key package. Identity-bound (not conversation-bound): joiners publish a KP before any conversation exists, so this method takes no conversation_id.

Implementors§