Skip to main content

MlsTransport

Trait MlsTransport 

Source
pub trait MlsTransport:
    Debug
    + Send
    + Sync {
    // Required methods
    fn send_commit_bundle<'life0, 'async_trait>(
        &'life0 self,
        commit_bundle: CommitBundle,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + 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<TransportData>> + 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: CommitBundle, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a commit bundle to the corresponding endpoint.

Source

fn prepare_for_transport<'life0, 'life1, 'async_trait>( &'life0 self, secret: &'life1 HistorySecret, ) -> Pin<Box<dyn Future<Output = Result<TransportData>> + 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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§