Trait MlsTransport

Source
pub trait MlsTransport:
    Debug
    + Send
    + Sync {
    // Required methods
    fn send_commit_bundle<'life0, 'async_trait>(
        &'life0 self,
        commit_bundle: MlsCommitBundle,
    ) -> Pin<Box<dyn Future<Output = Result<MlsTransportResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send_message<'life0, 'async_trait>(
        &'life0 self,
        mls_message: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<MlsTransportResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn prepare_for_transport<'life0, 'life1, 'async_trait>(
        &'life0 self,
        secret: &'life1 HistorySecret,
    ) -> Pin<Box<dyn Future<Output = Result<MlsTransportData>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Client callbacks to allow communication with the delivery service. There are two different endpoints, one for messages and one for commit bundles.

Required Methods§

Source

fn send_commit_bundle<'life0, 'async_trait>( &'life0 self, commit_bundle: MlsCommitBundle, ) -> Pin<Box<dyn Future<Output = Result<MlsTransportResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a commit bundle to the corresponding endpoint.

Source

fn send_message<'life0, 'async_trait>( &'life0 self, mls_message: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<MlsTransportResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a message to the corresponding endpoint.

Source

fn prepare_for_transport<'life0, 'life1, 'async_trait>( &'life0 self, secret: &'life1 HistorySecret, ) -> Pin<Box<dyn Future<Output = Result<MlsTransportData>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

This function will be called before a history secret is sent to the mls transport to allow the application to package it in a suitable transport container (json, protobuf, …).

The secret parameter contain the history client’s secrets which will be sent over the mls transport.

Returns the history secret packaged for transport

Implementors§